2 ms·
Some issues I had with the JS criticisms: * Many of the examples seemed really contrived. Yes, JS lets you overwrite methods for specific instances (which e.g.
by alangpierce 9y ago
Some issues I had with the JS criticisms:
* Many of the examples seemed really contrived. Yes, JS lets you overwrite methods for specific instances (which e.g. can be useful for testing) and assign to array indexes way outside the existing bounds, but I haven't seen either of those cause problems for people.
* The author repeatedly complains about missing features that would only make sense in a language with a type system. Many popular languages used by professionals are dynamic-typed. It's a legitimate way to do programming, and sacrifices safety in favor of flexibility. And just like how most static-typed languages compile to a dynamic-typed target language (usually assembly), JS has two good static type systems (TypeScript and Flow) that compile down to JS in the same way.
* Many of the criticisms apply to many programming languages, and I expect someone comfortable with a few programming languages wouldn't find them too surprising when learning JS. Examples: reference values, implicit exceptions, IEEE floating point edge cases, blockless `if`, switch fallthrough. And many of the examples are disallowed by the default configuration of eslint, which basically everyone uses.
* The criticism of ES2016 seemed really disingenuous, and ignored the vast majority of the progress made to the language in that year. There just happened to only be two features that year that crossed the finish line to make it into the spec. ES2015 and ES2017 were both much more significant, and the JS committee meets regularly and is actively working on about 50 different proposals simultaneously.
That said, some of the criticisms of JavaScript were certainly legitimate, like the `map(parseInt)` example and the `null`/`undefined` issue (although it still is a meaningful distinction that's occasionally useful).
- logicallee 9y agoThank you so much for taking the time to write this. It seems the points you raise are about syntax, how it is to learn and work with. But could we read the author's criticism as being about a different scale? How it stacks up as a project for huge, native-type applications? (I realize the author did not signpost this clearly, if this is what they had in mind, so I could be misreading them.) What do you think about this reading? I found your statement that (not a direct quote) "lots of languages do this and it isn't too surprising or hard to learn" a particularly good and simple answer to the author...so perhaps their motivations are a little different? What do you think? Thank you again for taking the time to write.