4 ms·
Yeah, JavaScript has problems but come on, just the fact that it has closures and first-class functions (and did a lot to popularize both, for that matter) make
by axguscbklp 7y ago
Yeah, JavaScript has problems but come on, just the fact that it has closures and first-class functions (and did a lot to popularize both, for that matter) makes it pretty cool in my book. It's a fun and powerful language.
The author also trots out the standard go-to argument of JavaScript haters. He writes that JavaScript "has deeply ingrained quirks and bugs which can never be fixed without breaking the millions of scripts that have made peace with the existence of those bugs and depend upon the well-known workaround" and he links to https://github.com/denysdovhan/wtfjs https://github.com/denysdovhan/wtfjs, a typical list of JavaScript's well-known type-casting quirks, etc.
Pretty much all languages have little quirks. Actual JavaScript programmers usually learn how to avoid JavaScript's quirks pretty quickly and easily. In my experience, people who fixate on JavaScript's quirks generally do not understand the language very well. If they did, they could criticize more substantial things about JavaScript than just things like "[] == ![]; // -> true".
- int_19h 7y agoWhat modern language doesn't have first-class functions and closures? (Except for C, but in that case it's obviously by design, and for good reasons.)
- tiborsaas 7y agoJava only added first class functions relatively recently
- int_19h 7y agoJava added them in version 8, which was 6 years ago. And it was one of the last mainstream languages to add that feature - even PHP and C++ had it for many years by then. So I don't think it's a useful metric for "cool" in 2020, and it hasn't been for a long time.