Hacker News new | ask | show | jobs
by _ar7 3311 days ago
It sucks that all of this is valid, but it's mostly avoidable. Eslint + Flow/TypeScript will catch most of these quirks for you.

Also lets not pretend that having a bunch of quirks like these is exclusive to JS. I'd say there are equally as many ways to shoot yourself in the foot in many other languages. For example, for C++, which isn't necessarily beloved but people don't want to "eradicate" like OP's comment states about JS, you can have an entire talk[0] on the quirks of type deduction.

I think where JavaScript earns its bad reputation isn't necessarily its quirks, but its quirks in combination with a low barrier to entry, lots of beginners, a large community, being a multi-paradigm language, and the fact that most people writing it were forced to write it because it's the language of the web not because they wanted to. All that in combination results in a lot of bad code...but if you take the time to learn it and use a bunch of tooling (which isn't ideal), it's actually quite nice.

[0]: https://www.youtube.com/watch?v=wQxj20X-tIU