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.