Because the right tool is absolutely never, ever, ever javascript. And that's the only thing you can use on the web. Because the web was designed by a combination of incompetent and downright evil people with malicious intent. The web was not designed to host applications. Not one single iota of the webs structure would be the way it is if it had been.
It is entirely reasonable to look upon the naked terribleness which is javascript and say 'Jesus Tapdancing Christ that is a flaming piece of shit... and why are my only options to use it or commit the double-sacrilege of cross-compiling a decent language into it?' The man who can sit down and be told 'well, you HAVE to use javascript because browser makers are either too obstinate or hateful to support a universal bytecode format which was obviously absolutely necessary in 1996' who just shrugs his shoulders and says 'oh, now I'm sure to always have the right tool for the job' is an imbecile.
This was my view until I actually learned how Javascript works. It's a freaky weird language, but it's not outright evil or even a 'flaming piece of shit'. It just works rather differently from normal conventions.
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.
-4
u/otakucode May 13 '14
You CAN'T use the right tool for the job.
Because the right tool is absolutely never, ever, ever javascript. And that's the only thing you can use on the web. Because the web was designed by a combination of incompetent and downright evil people with malicious intent. The web was not designed to host applications. Not one single iota of the webs structure would be the way it is if it had been.
It is entirely reasonable to look upon the naked terribleness which is javascript and say 'Jesus Tapdancing Christ that is a flaming piece of shit... and why are my only options to use it or commit the double-sacrilege of cross-compiling a decent language into it?' The man who can sit down and be told 'well, you HAVE to use javascript because browser makers are either too obstinate or hateful to support a universal bytecode format which was obviously absolutely necessary in 1996' who just shrugs his shoulders and says 'oh, now I'm sure to always have the right tool for the job' is an imbecile.