Idiomdrottning’s homepage

Runaway JavaScript Spec

XML is tree based. Logical and good, feels like all extensions have their perfect places, and it degrades gracefully if you are a little behind. Things can, in theory, also get deprecated (i.e. things that are too old could also degrade gracefully, if people would’ve been mature enough to remove old stale things from their specs—an example of this that did happen is <blink>; in many browsers blink text now is rendered as just plain text).

CSS is based around selectors and properties. Another setup that’s a very robust and future-proof spine.

JavaScript is a language that is grown in a wild way. Compared to languages ​​like Lisp and Forth that can be expanded with the same consistent, logical methods that XML and CSS can.

I mean, here’s the closest example I happened to have at hand:
JavaScript suddenly (and by “suddenly” I mean ES6, 2015) has a new loop syntax, for...of loops. They make up a whole new syntax and just “OK use this on wild code, good luck!” Now I’m not complaining about semantics — it’s good that we can do for...of loops type stuff — but that the syntax isn’t stable, that the question “what is JavaScript, really?” just explodes haywire.

(That WebAssembly makes “visiting websites” equal “immediate self pwn” is another, even worse, question entirely. It’s just separate from the rant at hand.)

I think JavaScript is a great language in many ways (or well, it’s basically just that I just enjoy working with prototype-based OO, not because it’s good but because it is fun). That anonymous classes and objects and also functions are so simple also makes us λ nerds feel at home. Crockford’s “JavaScript: the good parts” misses out on what I think are the real good parts. I used to do server side Java for a living and I’d used to be, like, “Wait, why do people complain about JavaScript compared to Java? On JavaScript there are lambdas and basically closures, here we need to do basically a functor class just to be able to pass a proc to another proc.” Of course nowadays in the era of node JavaScript is kicking Java out from the backend.

So it’s not that JavaScript itself is inherently bad. It’s that the Internet’s common client-side language should not have been a sprawling language like JavaScript.

Sprawling languages ​​like JavaScript fit perfectly on server side or on “installable” apps.

They don’t fit to be constantly evolving “OK listen up all clients out there, on Wednesdays we wear pink! Everyone hear that? OK.” A client-side-interpreted language can’t behave like that! That’s one of the core problems with the web’s runaway spec.