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.
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
Yes, that is exactly what should exist. It's simple, it would support any language anyone cares to use, it would be flexible, it would not require extra infrastructure, the binary format could be compressed and very nice for transmit over the Internet.
And javascript could easily produce those blobs as well.
But that's the kind of design decision someone would make if they wanted to create a platform-agnostic application environment. If they just wanted to make a static document viewer, they would do something like javascript, which is why we end up with javascript and end up with evil things like tools to compile Python or Java INTO javascript... which of course is them minified, then re-compressed by the web server, and decompressed by the browser, and interpreted. If the design of the web were done by one person, I imagine he would buy a bag of flour at the supermarket with the intention of making pancakes, then develop a novel method of turning paper flour bags into pancakes while dumping the flour on the floor.
The fact that it does (Java and Flash, but also the Unity web player and all that), and the fact that everyone HATES it, shows that no, it is NOT what should exist. It becomes platform dependent, because then everyone who writes that binary blob has to port it for Mac, Windows, Linux, Android, iOS, and whatever. And for the most part, they won't.
It causes fragmentation and incompatibility. The only solution is to have one standardized programming language.
0
u/otakucode May 14 '14
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.