It's also compounded because the majority of front-end developers write their code procedurally for each application component, which creates a terrible nest of repetitive and error-prone code.
They feel the pain, don't know how to solve it, so switch to a different syntax, blaming that as the root cause of the problem.
But feeling enough pain to viscerally HATE a language, as many front-end developers do, is not something that can simply come from the syntax of the language and the fact that the equality operator does type conversion and whatever small list of gripes users have. Most other languages (including CoffeeScript!) have a similarly-sized set of flaws and aren't nearly as derided.
As someone who has built large scale JavaScript applications, and has a lot of experience in other languages I really don't like JavaScript. My experience is that a lot of people know JavaScript, but very few people actually like it... Those people generally make writing JavaScript their day job.
Overall, cross browser js isn't really that difficult anymore and I rarely see people complaining about that. Of course, I've been part of the AltJS community for a while, and the people I follow closely are not front end developers.
A few of the weakest parts:
- for (var x in y) when used for array iteration or even dict iteration; hasOwnProperty? Really?
- x[obj] = y; seriously, did i really want '[Object object]' as my key?
- the choice of function level scope over block level scope
do ->
... local variables right here ...Lisp has block scope.
Can you write Lisp like this?
Function for(){ f(x); var x = 2; }
Compiles and runs with f(undefined)
https://hackpad.com/spTEgxqvFYj#Things-That-Suck-About-JavaS...
I don't know of any JS developers that hate JS. I know a lot that hate some browser implementations of JS though.
I agree with everything camus said. Yes JavaScript has some cool stuff in it, but taken as a whole it is a pretty shitty language. This has less to do with the creation of JavaScript than it does the practical reality that JavaScript cannot really be changed in fundamental ways without immense amounts of politics. Pretty much the entire time JavaScript has existed it was due to be fixed in a couple of years, but then political fiasco after political fiasco (eg. EcmaScript 4) delays this.
JavaScript as you can use it today sucks pretty much as much as it always has, and is only tolerable now because there are some good libraries that hide the shittiness of the language from you. Wouldn't it be better to have a web language without such a shitty core, that didn't require 100k libraries to hide you from the terrible bits?
Ah, the "only the libraries make the language tolerable" argument.
My experience has pretty much been that most of the devs who thinks the libraries are hiding problems with the language are confused on one or both of the following points:
1) the distinction between the DOM and JavaScript (for those who don't know: jQuery and the like address problems with the former)
2) the idea that a language is terrible if it doesn't have a specific class-based OO model
Hard to say in your case, though, given that you didn't mention any specific problems or solutions presented by specific libraries.
I use date.js or moment.js whenever I have to deal with times/dates in JS because the built in date support is pretty bad.
That being said, I think libraries like this take Javascript from being "tolerable" to "lovable"
Once you've studied and used languages like C, C++, Python, Java, C#, Haskell, Scheme, Erlang and Standard ML, you'll see what we mean when we say that JavaScript is a very flawed language. Pick any of its features, and compare that feature to the equivalent feature in the other languages. JavaScript's approach will generally be the worst of all of them.
http://elegantcode.com/2011/03/24/basic-javascript-part-12-f...
JavaScript has minor flaws but in general when understood it's outstanding. However it's not the style that you've been taught in school (OOP) and that's the problem for many newcomers.
It looks that you're just frustrated with something and want whole world to be as well, it won't work. Try CoffeeScript, it's much more approachable when coming from OOP world, then when you get how JavaScript works and understand it makes sense, you'll be ready to program in it directly.
It's easy to find JavaScript developers who love JavaScript solely because it's the only language they know. But once you start dealing with JavaScript developers who have a wider understanding of what various programming languages offer, the problems with JavaScript become much more obvious, and the hatred for JavaScript becomes immense.