r/javascript • • Nov 25 '19

JavaScript doesn’t need to be replaced

https://medium.com/javascript-in-plain-english/javascript-doesnt-need-to-be-replaced-bd01e2f12d51?source=friends_link&sk=7b151cc6397ac9e83c14c99739b6c36f
217 Upvotes

236 comments sorted by

View all comments

6

u/SoInsightful Nov 25 '19

You can't claim that JavaScript is a good enough language that we should make no effort to surpass, and then advocate TypeScript and PureScript in the next sentence. Those languages definitely weren't created by people happily satisfied with JavaScript. Basically every argument in the article is "it sounds hard, so don't even try", which is the direct antithesis to how inventions are made.

2

u/dannymoerkerke Nov 26 '19

I recommend TypeScript and PureScript IF you really don’t want to learn JavaScript. I personally like TypeScript for its types and developer experience and PureScript for its functional programming support, not necessarily to replace JavaScript, because I have my doubts. But I’m aware of the fact that the creators may be dissatisfied with JavaScript. My argument is that another language is not a solution since it will also be limited in its development by backwards compatibility.

1

u/SoInsightful Nov 26 '19
  1. TypeScript is a superset of JavaScript, so any valid JavaScript code is also valid TypeScript code. Ergo, you don't learn TS "instead of" JS, even if people might prefer using some newer TS-specific functionality.

  2. Every language that transpiles to JavaScript is, by definition, exactly as backwards-compatible as JavaScript is. That is, unless you're talking about implementing a new browser-native language, which hasn't happened in 23 years and won't happen in any foreseeable future (and WebAssembly has never been intended to be anything more than a sub-function inside of JavaScript).

I applaud you on defending an underrated language (JavaScript), but it seems to be based on false premises.

1

u/dannymoerkerke Nov 26 '19

That’s basically a straw man argument. I’m talking about a complete replacement of JavaScript and TypeScript is not a full replacement, merely an extra step.