It’s always been fun and cool to make fun of Javascript. It was a famously created in 10 days which created consistent bugs the world over (I’m lo

Abusing Javascript’s Rules

submited by
Style Pass
2024-05-13 02:00:06

It’s always been fun and cool to make fun of Javascript. It was a famously created in 10 days which created consistent bugs the world over (I’m looking at you var). Since the introduction of ES6 standard of Javascript, things have gotten a lot better: const and let for more consistent scoping, string interpolation, and many other things have created an even more friendly developer experience.

Even with the above additions, Javascript still has a bad rep amongst developers for not being like languages they’re already used to using, going as far as to say things like:

Which is totally something I would have said before spending anything more than an hour playing with the language. Now that I’ve had a bit longer than no time at all playing around with the language, I can say that that the only sin that Javascript commits is the sin of automatic type conversions. If you’re unfamiliar, type conversions are basically converting some type T like number to some other type S like string . Everything else can be found in any other language.

At first, I sincerely used it as a reason to steer clear of the language. “How can someone seriously use this language?” I would say to myself, atop my high horse firmly planted in the ivory tower of strongly typed languages. After looking into the reasoning behind each of these, I have come to the only conclusion this absolute slander has been made by the anti-js gang. These results fall into three main categories: 1) lack of understanding of the number type 2) plain slander 3) type conversions.

Leave a Comment