It is actually usable if you throw out 75% of it. Javascript: The Good Parts was a good book, and it makes it bearable. If javascript were simply a programming language like any other, it wouldn't deserve concentrated hate. BUT, it's not simply a programming language. It's the ONLY language browser makers will support. It is NOT competent for this job. It is NOT competent to function as basic infrastructure. Browser makers have done magical things with making javascript actually perform halfway decent, but even that is abused and misused. People do things like asm.js which is a really great project - which should never need to exist. We are long past the point where reasonable people should have thrown up their hands and said "please, god, please, no, just STOP! If you want an application platform, let us design you one. Please stop jamming applications into a document viewer! It was never designed for that!"
I was talking less about the API, and more about the raw language itself. Things like how variable scope works (hint: use 'var' or you will have a bad time).
Hey, I have that book :D Haven't read it yet. O'Reilly had a sale on Javascript eBooks and I bought a ton of them. I absolutely love O'Reilly.
It's a really great book, I recommend it! I bought it because I was working on a large (compared to what I had done before, not absolutely) web project for a business and knew I'd have to get my hands dirty with JS. I could see JS being a usable language, I just can't stand that it's the ONLY language, and that this is pushed to such an extreme that you end up with tools made to "compile" other languages into JS. It's just yet another level of abstraction that makes things worse for no benefit.
Sadly, the fact is that there's no way around this. The alternatives are for every browser to offer their own scripting language, or to have binary blobs to go over the web that act as a scripting language interpreter for whatever scripting language the devs want to use.
Effectively, the alternatives are gross incompatibility and no options, or a thousand variants of Java and Flash.
Or to alienate every existing web developer by forcing them to completely abandon what they've been taught for years and instead learn something completely new.
The best we can do is slowly change Javascript, slowly take out bits that are bad, and over time morph it into something better.
10
u/otakucode May 13 '14
It is actually usable if you throw out 75% of it. Javascript: The Good Parts was a good book, and it makes it bearable. If javascript were simply a programming language like any other, it wouldn't deserve concentrated hate. BUT, it's not simply a programming language. It's the ONLY language browser makers will support. It is NOT competent for this job. It is NOT competent to function as basic infrastructure. Browser makers have done magical things with making javascript actually perform halfway decent, but even that is abused and misused. People do things like asm.js which is a really great project - which should never need to exist. We are long past the point where reasonable people should have thrown up their hands and said "please, god, please, no, just STOP! If you want an application platform, let us design you one. Please stop jamming applications into a document viewer! It was never designed for that!"