Is JavaScript getting worse?

Any headline which ends in a question mark can be answered by the word “no.”
Betteridge’s law of headlines

There is a lot of anticipation about the next release of JavaScript, ES6. There are certainly going to be some very nice features:

But JavaScript is not content merely to improve. It has to maintain – and even increase – its lead in WTF’s per minute.

Classes. Whoop-dee-freakin’-doo. Very hard to get excited about quadrupling down on a bad bet.

Default parameters. By itself, this is another “so what” feature. But default parameters have an obnoxious side effect: They are not reflected in the function’s length property. This makes currying tricky indeed. With Ramda you could hack around this infirmity by specifying arity when currying with curryN, but geez. C’mon, man.

let considered harmful The problem with let is that it is not “hoisted” to the top of its block, as var is with its containing function. So if you:

      (function() {
         "use strict";
         console.log(x);
         let x = 1;
      }())
      

you will get “ReferenceError: can’t access lexical declaration ‘x’ before initialization.” This means that typeof can now throw. It’s like the let keyword has inadvertently introduced a new kind of nil value to a language that already has at least one too many.

So is Javascript getting worse? Well … no. But that doesn’t mean it’s only getting better.

Buzz de Cafe 08 January 2015