10 biggest JS pitfalls

Claude Pache claude.pache at gmail.com
Sun Jan 6 13:08:43 PST 2013


>> 
>> On Sun, Jan 6, 2013 at 5:06 AM, Axel Rauschmayer <axel at rauschma.de> wrote:
>>>> <snip>
>>> 
>>> This is not about pointing out how bad JavaScript is, it is about collecting things that confuse people who are new to the language. They help those people to learn what you already know. Many people really hate JavaScript. Some of those, we’ll never convert, they’d rather program Java than JavaScript (as you point out above). But some do cite valid WTFs. Some of those WTFs even get you if you know the language well (e.g. `this` in non-method functions). Thankfully, ES6 will fix many of those. It’ll prove the haters wrong who say that JavaScript is beyond fixing.
>>> 

Well, with this explanation, I understand better the sense of your three first "biggest pitfalls": They are just things that confuse people coming from some other definite programming language and accustomed to different semantics.

You probably won't say that the OO model of Java (for example) is a pitfall (even less a "biggest" one), even if it may confuse people new to OO-programming; rather it is a handful feature that works well. In the same vein, the notion of truthy/falsy, the sloppy == operator, and the distinction between null and undefined, do not deserve to be called "pitfalls" or "warts", for they are indeed positively useful features (and much easier ones than classes and objects) that work without problem once you have correctly learned them.

(BTW, "Some of those, we’ll never convert, they’d rather program Java than JavaScript." I bet that those people don't know how much they lose by not having proper first-class functions ;-)

—Claude
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130106/45d59abd/attachment.html>


More information about the es-discuss mailing list