Time for JavaScript.NEXT

OK, I’ll admit that HTML 5, when it becomes a true standard and the common browsers implement it and all of CSS 3 that we won’t need as many browser plug-ins for doing rich interactive applications anymore. We could ditch Microsoft’s Silverlight and Adobe’s Flash and not look back.

But, to do that, we need to move the web to a better programming language!

Reading this rant from MG Siegler on Tech Crunch made me want to come clean about my true feelings.

As Google Backs Away From A Plug-in, Microsoft Rushes Towards One

I don’t want to need Flash or Silverlight.

But, I’ll take either of them over programming a large scale web application using JavaScript – since both of them have a modern programming language (ActionScript 3 and C#). Seriously. JavaScript, born in 1995. It’s 14 freaking years old as of this December (as it was first released in December 1995). We’ve got budding programmers who were born AFTER it was created. JavaScript, unlike many of it’s commonly used, similarly aged counterparts, has not had any significant upgrades or improvements to reflect new market needs. Java and C++ both have (Java got generics for example), and C# was born in the last decade. I like Silverlight more than Flash only because of the programming language (and IDE) attached with its development.

Here’s my short list of complaints about JavaScript:

  • Dynamic typing – great, I can’t know until runtime what a type should be, and even then it could change. Makes for a great time.
  • Prototype – oh don’t get me started on the patterns that are necessary to create a robust object oriented framework in JavaScript – and “this”, and “oops, you’re missing a comma, good luck finding that!”
  • Closures – the source of too many memory leaks and confusion over the years, especially given the subtly of its behavior in JavaScript
  • No official “imports” or “usings” to make doing code-completion practical, and one JavaScript file can’t declare another JavaScript file as a dependency and have it automatically be loaded (just once of course), without creating a new framework.
  • Run-time code discovery – it’s great to be able to load things dynamically, but it’s completely a mess at design time trying to sort everything out and make sense of a large application.
  • Debugging – terrible IDE and debugging support across the browsers. Too many “alert” style debugging workflows in this day and age.
  • Interpreted – still making the browser do extra work and a bonus feature: you don’t know about coding errors until you try to execute the code!
  • Poor internationalization support – to do it right, you need to build functions or get a library to parse and format properly

(Don’t get me started about the inconsistency of DOM access from JavaScript across browsers – which I realize isn’t JavaScript – it’s a browser thing – but they’re intertwined from all practical purposes).

(And, I’m not complaining about a web application that consists of 2 JavaScript files, where one of them is JQuery. Think big. Applications. Complex workflows. Frameworks. Etc. It’s tough stuff. It’s doable, but unnecessarily difficult).

Major Web applications would have taken off long ago if the entire development experience/environment would have modeled after something like Visual Basic 3, 4, 5,  or 6. Web applications are still held back by an awful development experience.

Do you love JavaScript? Does it need to be upgraded to this century?

Updated to reflect a bit of ranting inconsistency.

2 Comments

  1. Why do you complain that JavaScript, as a language, was first released in 1995? A selection (from Wikipedia):

    C – 1972
    C++ – 1983
    Objective-C – 1986
    Python – 1991
    Ruby – 1995
    Java – 1995
    PHP – 1995

    C# is the only mainstream programming language I can think of right now from “this century” (Visual Basic’s root as a language are much older). So why complain about the age of JS, but not mention Java, which is just as old (or even 4 years older, if you count Oak)?

    Debugging is a problem since there’s no single vendor for JS “solutions” as there is for C#, where the language designers and tools developers interact. Hasn’t stopped the rest of the world from developing great stuff in JS, PHP, Python, Ruby, Perl, or even C++ (a language in which the MS developer tools fail miserably compared to the C#/.NET tools).

    It also seems you compare JavaScript to Silverlight. One is a framework, the other a programming language with a rather minimalistic default library. That’s why there are many libraries, some of them good, for it. Just have a look at Cappucino and the Atlas demo. Great stuff, all of it JS (and they implemented a new Objective-C-like syntax on top of it, which is even older!)

    I am not a fan of JavaScript either, but I think you mistakenly attribute many of the pitfalls in JS development to the language.

    1. Good points. My ranting was inconsistent. Hopefully rectified that with a few tweaks as I realized those other languages were old as well.

Comments are closed.