4 ms·
"Even if JQuery isn’t the reason JavaScript is so hot right now, do you honestly think JavaScript would have become so popular if JQuery never existed?" Yes, I
by smacktoward 14y ago
"Even if JQuery isn’t the reason JavaScript is so hot right now, do you honestly think JavaScript would have become so popular if JQuery never existed?"
Yes, I do, for the simple reason that JavaScript is the only language that runs in every browser, full stop.
It doesn't matter how ugly it is. It has the privileged position of being the only language that runs in the browser, so if you want to do any kind of client-side scripting, it's JavaScript or nothing.
This makes the emergence of frameworks to smooth over the language's pain points inevitable. If jQuery had never been invented, Prototype or Mootools or one of the zillion other frameworks would have taken over the world. But JavaScript's monopoly over scripting the browser is what drove all those frameworks' popularity, not the other way around.
"JavaScript has some things that are fundamentally wrong with it that no amount of covering up or pretending will fix."
As long as JavaScript is the only way to script the browser, whether JS is fundamentally flawed or not is sort of an academic question. It remains the only way to get from point A to point B regardless of its flaws.
"Even though the world seems bright and cheery for JavaScript developers today, it also seemed equally bright and cheery for Blackberry devs not too long ago. And look how that turned out."
Blackberry devs are getting pummeled because there was somewhere else for Blackberry users to go. Where else are JavaScript users supposed to go to script the browser? There is no alternative.
"Take JavaScript away and replace it with another programming language and you don’t really miss anything."
Except that in practice, you can't do that. Browser vendors can do that, but none of them appear to have any interest in doing so. (The article mentions Dart, but Dart compiles to JavaScript.) And that's not even considering what would happen if all the browser vendors backed different languages... oy.
Way back in the earliest days of browser scripting, it was thought that languages would be 'pluggable' -- that there'd be, say, a Python plugin for your browser, and devs would be able to script the browser in Python through it. (Which is why up until HTML5 SCRIPT elements were required to include a TYPE attribute; it was assumed that "application/javascript" would be just one type among many.) But that never happened.
"You can only build so much on top of something else, before you have to wipe the slate clean and start over."
There's no practical way to wipe the JS slate clean. JS is out there, right now, baked into a gazillion different browsers and devices. Even if you come up with a better alternative, how do you get it into enough of those browsers and devices to create the critical mass required for developers to start writing for it?
The only practical answer is that you get them into new browsers and devices, and then wait for all the old ones to die or be replaced. Which means that if something really does rise up and try to replace JS, you will have pleeeenty of lead time to get ready for the change. Like, decades of it.
- dccoolgai 14y ago"Which means that if something really does rise up and try to replace JS, you will have pleeeenty of lead time to get ready for the change. Like, decades of it." Amen. I am getting kind of tired of this litany of breast-beating over how "ugly and awful" JS is and how it is "doomed". I find that the things that make JS "ugly" to a novice (functional scoping, module patters, etc.), are the same things that make it powerful and elegant in the hands of an expert.
- joshguthrie 14y agoAmen to that. Now let me in peace declare my functions that will return functions that will return closures. These articles are silly and I don't see how this is even "hacker news" (oh wait, OP is the author, makes sense)... I don't use Lua, I have/see/envision no interest for Haskell other than as a toy, the latest Java 0-day exploit is only 15 days away[1], PHP still looks like a mess to me and I abhor C++ (and Rails too, but it's another matter). Yet I wouldn't ever call one of these languages "doomed" because I know that my personal vision isn't the vision of our industry and that even for something as strange as brainfuck, there'll be an engineer who will find uses for it[2]. What I find even more about this article is that we are a community where so many of "us" are already suffering from depression, Impostor Syndrome[3] and many other "bad emotions" and someone is still out there preaching negativity, telling us how people who "put all [their] eggs in javascript" aren't "smart". What's the point? Didn't we learn from our own DongleGate and similar events that this attitude was in no way the winning attitude that our more talented peers exhibited to elevate themselves? If you don't want to be the next PG, Zuckerberg or any 10X engineer, go ahead! But don't try to drag anyone with you down a hole of your own making. [1] http://java-0day.com/ http://java-0day.com/ [2] http://modbf.sourceforge.net/ http://modbf.sourceforge.net/ [3] https://news.ycombinator.com/item?id=5664839 https://news.ycombinator.com/item?id=5664839