25 comments

[ 2.8 ms ] story [ 75.4 ms ] thread
If one of these hundred alternative languages that compiles to JavaScript takes off ( https://github.com/jashkenas/coffee-script/wiki/List-of-lang... ) AND has features that would benefit from a better underlying "assembly" language (like Dart from Google, Typescript from Microsoft, or asm.js from Mozilla), then I would say Javascript's days are either numbered, or it will finally adopt static typing, as was proposed a decade ago for JavaScript 2.0 or ES4 or whatever: http://www-archive.mozilla.org/js/language/js20-2000-07/libr... http://www.webreference.com/programming/javascript/rg38/2.ht... http://www.ecmascript.org/es4/spec/overview.pdf
But languages that compile to javascript still presuppose javascript.
Assuming they only ever compile to JS, yes. It's possible Microsoft could get buy-in from the IE team to run TypeScript natively. Dart already runs in a VM in a version of Chrome.
That's all well and good for that one browser. But that's the bleeding edge of the bleeding edge.

For the sake of legacy code browser vendors would still have to support javascript natively for the indeterminate future as well. No one's going in and changing the umpteen million lines of extant javascript to Dart no matter how many browsers can run it or how semantically nice it is.

I do find it ironic that a post that talks about why JavaScript is doomed gives an "error establishing a database connection" message.
Whoops, somehow caching got disabled. Reenabled now. Thanks for pointing that out.
I think a much clearer argument would be: 'Developers want great tools. JavaScript has too many tools which induces the paradox of choice. A better tool might replace JavaScript in the future because of this.'

I personally am developing applications with minimal JavaScript a la Pinboard.

This is a pretty shallow article. It's a lot of text for not saying much.

The parts that are actually substance consist mostly of broad unsupported claims and very general unrelated facts about JavaScript. It's as if Leo Laporte wrote it.

Comparing JavaScript to BlackBerry doesn't make any sense. Most people replace their devices every 2 years. Unless you like wasting time you're not going to rewrite your app every time a new better language comes out.
The premise that you can just "take away JavaScript" is false and thus the implication is false.

It is exactly the ubiquity of JavaScript which makes it nearly impossible to "take away" and which makes it useful!

Dart probably won't succeed even though it is arguably a cleaner and prettier language simply because JavaScript is good enough and it is everywhere.

This is a really poor article. It doesn't really explain why JavaScript is doomed. It doesn't explain what's bad about JavaScript... but then he goes on to list some frameworks on top of JS that are awesome. Sorry, but if JS sucked, then how is it possibly to have awesome frameworks derived on top of JS? Surely, those are examples of how cool JS is. And how can you say Node.js is cool, but JS sucks.

Sigh... Besides that this article is a jumbled mess to read, the TL;DR of it would essentially boil down to: "I don't like JavaScript because I don't like the way it looks. It's doomed!"

Where does he get off talking about sweet potatoes like that? The nerve of some people!
Is this article for real? I am trying to decide if the author is being ironic, sarcastic, or doing some kind of double message.

Taken at face value, this is just link bait.

The message is just that JavaScript is doomed because too much cruft has been built on top of it, and the real value isn't JavaScript anymore, but the libraries built on it. Something will come along and make it all easier, without having to build 50 libraries.
Link bait indeed.

Ooh, a video!

Do go on. Seems to me -- in this week where a 1080p video decoder written in JavaScript was demoed -- that .js is as capable as ever.
Libraries like jQuery abstract the DOM more than anything else, no? The DOM is what people paper over. They want a better API for traversal, filtering, events, manipulation (incl. CSS), and so on. In that light, you might actually want a language where higher-order functions are possible.

Also, it's a bit contradictory to argue that you could replace JS with any programming language and simultaneously argue that JS is garbage. In fact, if you simply swapped in Ruby, your argument would be largely the same; you'd still be stuck with the DOM and CSS.

JS isn't a perfect language. The latest disappointment for me is the lack of any well-defined module or namespace system; it forces people into ad-hoc solutions when Python, Ruby, or other dynamic languages have pretty good systems.

But there's nothing egregiously bad about the language, at least IMHO. What the author really seems to hate is web development, including CSS and the DOM, and probably the fact that they hardly have any choice. (Not coincidentally, I suspect this is why many people have problems with JS. I am sympathetic.) I suppose something nuanced like that makes for a less linkbait-y headline, however.

"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.

"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.

Amen 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/

[2] http://modbf.sourceforge.net/

[3] https://news.ycombinator.com/item?id=5664839

There are a couple of very nice points in that wall of prose;

You are not your technology - This one bites new engineers all the time, they mix up the fact that they are really facile in <tech> with they are smart capable developers. So they mistakenly react to attacks on <tech> as personal attacks. After you've learned your fourth or fifth programming language they begin to blur together.

Languages are not islands - which is to say that nobody writes 'pure' language <x>. They call libraries and those libraries provide abstractions for getting things done. So when the libraries are good for what you are trying to get done, the language is great. This is why perl is great for some things, and why C++ is great, and yes even Java can be pretty useful too. If you're trying to do thing <x> and there is a lot of support for doing <x> like things in the libraries that come with the language, then you can be forgiven for imputing that value to the language rather than the environment around it.

It's not doomed though, and it can't really be a bubble since we're not talking about money here. If some new language is developed that runs in browsers it will be wounded, perhaps mortally, but until then that spot is pretty comfy.

i wish it were doomed... javascript should've been replaced with something more sane in the late 90's. unfortunately, that didn't happen and it is here to stay.
Here's the thing I find about people that say JavaScript is doomed. Most of them never actually bothered to learn JavaScript. I run a shop with about 10 programmers and because, most of the time, we work in small projects for a multitude of clients we all master in different programming languages/frameworks. I’ve seen Perl written in JavaScript, Java written in JavaScript, C written in JavaScript. Mind you, I've hacked in JavaScript for years before actually I started learning it in depth. My C#/Java programmers spend most of their time whining about how JavaScript should have namespaces, how inheritance this and why closures that. Just because JavaScript has a low entry point doesn't mean you shouldn't invest time learning it. I seriously believe that if we invested a 1/4 of the time in JavaScript as we do with our favorite languages I’m pretty sure we would be seeing a (hell) lot less of these articles.