I heart ECMAScript (poll)

I’ve coded in C, C++, Delphi, Basic, VB, VB.NET, Java, Perl, PHP, ColdFusion, Pascal, 68k assembler, and probably a few other languages that I can’t remember right now. And yet, my absolute favorite has to be the many-headed beast that is JavaScript, ActionScript, and ECMAScript.

  • Fewer syntactic hurdles
  • Lots and lots of literals
    z = {'foo':3.14, "truefalse": [true,0]}
  • Functions are first-class objects
  • Anonymous objects and functions are wicked easy
    doSomething(123, function(a) { return a + 1; })
  • Version 4 allows for typing hints
    name: String = "Rick"
  • There’s a ternary operator (don’t scoff until you’ve had to use a language without one)
    i = (j == 3) ? 'a' : 'b'
  • Literals are objects
    s = '0000'.substr(0,4-t.length) + t

Admittedly, that last example is nasty-ugly, but I like it. What say you, thunderbolt?


By Rick Osborne

I am a web geek who has been doing this sort of thing entirely too long. I rant, I muse, I whine. That is, I am not at all atypical for my breed.