top | item 9241765

Why people hate JavaScript?

7 points| joescript | 11 years ago | reply

I think the reason people hate javascript and node.js is the fact many prefer python which is cool because i like python also but most people hate the syntax because they can't write code. coming from a C/C++ background one must learn how to write code clean. language like perl fall under here too with C,Lisp etc....

28 comments

order
[+] xxgreg|11 years ago|reply
I don't hate Javascript, but I hate that I've have spent untold hours of my life on bugs that could instead have been immediately flagged by a static analyser, or been a runtime error at the source of the problem, instead of a weird bug in a totally different part of the program.

Javascript has a number of issues that make static analysis hard. It also has implicit conversions and other oddities which mean that code often keeps on trucking after a programmer error, rather than failing where the initial problem was.

These problems were solved in other languages decades ago - which is why many developers "hate" switching to Javascript. It's coding on a tight-rope without a safety net.

The meme: "You're just a hater, because you don't know how to use it", is a joke. Javascript has issues, hopefully they can be fixed, but fixing them without breaking compatibility is difficult. Being honest about Javascript's flaws doesn't make you a "hater".

For the record my first JS project was Netscape 2 compatible. So I'm pretty sure I know how to use it.

[+] elviejo|11 years ago|reply
Apart from all the inconsistencies in this talk? https://www.destroyallsoftware.com/talks/wat

How diferent browsers implement the language? How diferent sucky the communication with the DOM is? How verbose it is? How there are 4 ways to do anything and 3 of them are wrong and the one correct way has changed according to time?

I guess nothing.

[+] joescript|11 years ago|reply
the fact the many browser are like an OS in the sense it's home for the web but many vendors tend to believe that they can control the web by shift their browser to standards to try to control it. Remember the web a free communication source that gave everyone in the world knowledge, where we all grow
[+] api|11 years ago|reply
It's used almost entirely to write async code, and had no good native constructs for async other than cascades of callbacks or non-standard libraries implemented on top of callbacks that are confusing to use.

So it's horrible for its most common use case.

It's type system is also a total joke. Typeof returns a string? Array.isArray()? ===? Just wow.

In general, programming tools get worse as they near the UI layer. It's like a passive aggressive way for programmers to say they hate writing user focused things. At least that's my armchair theory about why UI libraries, the DOM, etc. are so badly designed and hard to use compared with systems software or algorithmic code.

[+] joescript|11 years ago|reply
truth, but its up to us as programmers to make it better by combining logic and design. for mostly employment reason etc.... but i prefer low gui and more command line in exp, more flexible/powerful than any gui exp :)
[+] matt_s|11 years ago|reply
This concept of hating tools is sort of silly. Would you ever hear a plumber say they hate that wrench? Nope. You might hear them state that an install job with pex is easier than copper or pvc, and it requires different tools.

Like other posters in this thread, I remember back to the "browser wars" between IE and Netscape. There is a gigantic thick book on my bookshelf called Dynamic HTML and it had notations on what methods, elements, etc. worked in what browser. It was much more painful back then to use JavaScript.

It is a tool and necessary for web work. You can go crazy with it though and write entire apps using just JS, not sure that would be recommended though, seems hard to maintain.

[+] ams6110|11 years ago|reply
If you time-travel back just a decade ago, javascript was thought of as a little toy language used to implement minor effects or validation on web pages. If you had suggested writing any kind of serious application logic in javascript you would have been laughed out of the room.
[+] CyberFonic|11 years ago|reply
I actually like JS, but it bothers me heaps when something fails silently. That is, something doesn't happen and I have to go hunting to find out where the problem is. In most languages I would get an exception, an error or at least a warning.
[+] mattmurdog|11 years ago|reply
This can be resolved very easily with inspectors or writing educated console logs.
[+] joescript|11 years ago|reply
That is true, it something is needed in the language
[+] itsbits|11 years ago|reply
People coming from other Programming Languages background tend to dislike JS mainly because of prototypal and Functional approaches coming together.

-They want to create a class by calling class.

-If they call 'this', it should be always from Object context.

....

There are many cases which Javascript ruin their concepts from them. Although few years ago I switched to JS from Java, I infact not a fan of new ES6 introductions like class, extends, let.

[+] joescript|11 years ago|reply
As programming grow, new thoughts and ideas we have coders have to think of new way of doing things. so far it has work. now the question is that with this new way of doing things how should we resolve,approach of use this?
[+] metaculus|11 years ago|reply
Even the President coded in JavaScript. What makes you think people hate it? JavaScript is everywhere and it's leveraging the power to build the web to more people. The language has its flaws and beauty. Once you understand its "everything is an object" you'll see it's inner Zen.

There's absolutely no way you can code and dodging JS.

[+] arisAlexis|11 years ago|reply
let me reply with a question: If javascript had good structure why ES6 adds so many new "improvements", why developers were using Typescript and Coffescript, why Google made Atscript and Dart? Just to have fun or maybe because the language has (debatably) serious design flaws?
[+] joescript|11 years ago|reply
yes I agree on the Improvement but like it has been mention it was a Toy language in the sense of as not so verbose. but remember Html and CSS were missing of feature and structure for manny reason. as Programmer, Hackers and Tinkers it is up to us to improve on these things. the web continue to grow. js is the C of the web and by the looks of it, it will be this way for a while. dart is cool but something i believe it can be applied across the board.
[+] joescript|11 years ago|reply
But the language gave the web the foundation it need to have functional programming for the web. also it is quick to have a low end laptop or device and still learn to program. but we got to admit it has grown and evolve more than ever.I guess we will see how things go.
[+] Blackthorn|11 years ago|reply
Concurrency is very important nowadays, and it's substantially more important in UI code. Javascript has the single worst concurrency "model" of any programming language I've ever worked in.
[+] haidrali|11 years ago|reply
who hate it .... ? JavaScript is future
[+] shortoncash|11 years ago|reply
I feel like you can find the answer to this question by looking at how Google's Dart looks and works versus Javascript.

Dart is just clean. Javascript is just the unfortunate mess we are stuck with.

[+] joescript|11 years ago|reply
Clean is good, but not always better. also having a language controller by one company will make the language bias
[+] cs-|11 years ago|reply
Loops - they just hog every cycle from your CPU (and the lack of sleeping for that matter)

And to answer your question: I love it, it's like a virus: everywhere.

[+] zer0defex|11 years ago|reply
"people" hate javascript. "they" can't write code.

i've learned from experience that "people" who use generalized statements like those will never be the superstars that make real shit happen. they're far too insecure, attacking perceived weaknesses of the tools used rather than the work output and very often, results achieved. elitism by attacking toolsets is insecurity driven by lacking experience and ultimately, lack of skill, nothing more. who the fuck cares what tools are used? did the project get results?

that's the lowest common denominator.

[+] mattmurdog|11 years ago|reply
This is absolutely correct. People who hate JS can't properly code JS. It's a fluid language that can be done in several ways and unless someone understands it fluently they will merely think it's "not a real" language.
[+] MichaelCrawford|11 years ago|reply
C and C++, even FORTRAN can be written in a very clean, easy to understand and maintainable way. If you can't read someone else's source code because of the way it's formatted, it's their fault and not the fault of the language.

I've seen plenty of spaghetti javascript.

My gripe about javascript is in part that all the browsers support it in significantly different ways, and that a great deal of JS is written by web designers who really don't understand computer programming.

[+] joescript|11 years ago|reply
I agree in which gives it a bad rep, but also vendors are at fault with this. because the web is freedom and they wanted to claim it. it which cause a big rip. remember the web gave us so much in the programming world. also Php and non-python(i like python)language can be written very clean, easy to understand and maintainable way. but some people use python because that reason mostly. which should be the only case. sorry Guido
[+] MichaelCrawford|11 years ago|reply
I have avoided javascript in my own work for many years, but now am diligently working to learn it.

My reason is that I am very good at debugging, and so have the idea I could score a lot of consulting contracts by offering to fix broken javascript code.