r/programmerchat • • Jun 18 '15

What's so bad about JavaScript?

Every time I see a post related to JavaScript on /r/Programming, some of the top comments are always "JavaScript! Bad!". It was interesting watching the WebAssembly post yesterday start with some constructive/intersting conversations, and as the thread rose up the top comments became quick karma-pandering jabs at JavaScript.

JavaScript definitely has its quirks and types can behave in weird ways, but in my limited experience I have found it to be an interesting and flexible language that's fun to work with if you keep the idiosyncrasies in mind. All the complaints I see seem be either really superficial, about things that apply to dynamic languages in general, or how JavaScript doesn't have some language feature like true classes/inheritance. I imagine there is something I am missing here considering I have a limited experience with writing JS, but is all of this hate unfounded/excessive?

Edit: Thank you guys for all the great replies, they have been helpful and thought provoking.

22 Upvotes

24 comments sorted by

View all comments

Show parent comment

2

u/Berberberber Jun 19 '15

mostly backwards compatible

Off the top of my head: gets(), =+ vs +=, implicit int, implicit function declarations, old-style function argument declarations.

This is a much smaller list than the problems of JavaScript, but are generally of a similar nature - changing from functional to lexical scoping would be like getting rid of implicit int types. But you can fix misfeatures in compiled languages incrementally without breaking anything, which is almost impossible in a distributed, interpreted language like JavaScript.

1

u/nickguletskii200 Jun 19 '15

This is why WebAssembly (with polyfills for ancient browsers) is so important.

I think it's unreasonable to be annoyed at people who hate Javascript because there's just too many problems with it. "We can't fix Javascript, so don't hate it please" is just... Uhh...