Let’s Talk JavaScript

Back in 2008, at the height of the Web 2.0 craze I wrote a post titled JavaScript will the the next big language. Four years have passed, and yeah – it happened. Not necessarily in the way I expected it to happen.

For one, I expected Rhino to become much more relevant that it did. Instead we got Node.js which came completely out of the left field, and was designed to be a completely different animal. And yet, it was the type of end-to-end JavaScript solution I was anticipating. There were other attempts at this before it (and I mentioned several of them in my original post), but Node.js is the one that hit it big, and gained a large, supportive community. It is likely that it’s success had nothing to do with JavaScript and everything to do with the concepts and goals behind its design. Which is more or less how it has always been for JavaScript – it has always gained ground not because it was great, but because it was good enough tool for a specific purpose.

But I think starting this discussion with Node.js was a mistake. In the grand scope, it was merely a drop in the bucket. It did not cause the JavaScript revolution I was expecting. In fact, there was no revolution at all – only a ceaseless march of progress. The Web 2.0 came and went and it left us with mountains of new client side code. It pushed what could be done with the web to the limits, and forced progression. Compared to 2008, we now live in a world where:

  • Asynchronous JS is not just some new quirky thing, but a commonplace practice. We don’t even call this sort of thing Web 2.0 – we just call it the web. Users are now accustomed to interfaces that are dynamic and do not require reloads.
  • We have a body of mature JS frameworks that streamline web development. Things like jQuery or Prototype abstract a lot of the hairy, browser dependent busywork and boilerplate code, and encapsulate a lot of what was invented in the Web 2.0 craze into simple function calls.
  • The IE team at Microsoft actually gives a shit about standards and competitive JS performance. The fact that IE9 actually doesn’t suck completely blows my mind. To put it in perspective you have to remind yourself that Microsoft kept IE at version 6 for 8 years during which they didn’t do any development on the browser other than routine bug-fixes.
  • HTML 5 is actually making the web more dynamic and JS more relevant and more useful than ever. From now on, web designers will be able to rely on web browsers to implement things like local storage without the need for kludges like GoogleGears, and will be able to do real concurrency with natively implemented web workers.
  • JavaScript is used to develop Metro style apps for Windows 8 and Windows Phone. I particularly like how this is essentially MS extending their collective middle finger towards the .NET community saying “this is what you get for contributing to Mono”. But I digress.

Right now, both Google and Microsoft have vested interest in making JavaScript good. Google uses it in all their web applications, while Microsoft just bet on it to be the first class development language for their Metro apps. So we could say we are in the midst of escalating arms race of who can get the damn language running faster and more efficiently and on which platform. And unlike such arms races in the past where Microsoft could just embrace and extend to win, they are actually the underdog this time around and have to play by the rules which means the web as a whole can only benefit from this exercise.

Needless to say, if you are doing anything even remotely related to the web or the mobile sphere, JavaScript is going to be there in your face. It is ubiquitous and unavoidable at this point. And it is still the same mess of a language that we came to know and love all these years ago. For all the interesting infrastructure, frameworks and new platforms that grew around and on top of it, Javascript is still quirky as fuck.

I have been really enjoying the series of JavaScript related posts Chris has been posting over at Null Program in which he is featuring some of the more interesting quirks for the language such as:

These are informative, educational and show just how weird it can get when you start messing around with this language. JavaScript is great, JavaScript sucks – it doesn’t matter. We are stuck with it for the time being. It is the lingua franca of the client side scripting and I don’t see it changing anytime soon. Unless of course Google can actually make Dart happen. And right now it is not something that is happening because it’s JS fallback leaves much to be desired.

What is your take on this beautiful, quirky, fucked up language of ours? Do you love it? Do you hate it? Do you respect it despite it’s flaws? What are your favorite JavaScript quirks? Let me know in the comments.

This entry was posted in Uncategorized. Bookmark the permalink.



5 Responses to Let’s Talk JavaScript

  1. You sure got a lot of hate in the comments on that old post (April 2008), even though you were generally right about JavaScript’s future. As you mentioned, not only did IE9 (2011), Node.js (2009), and HTML5 (2008) not exist when you made that prediction, but there are a few more things you missed:

    * Google Chrome and V8 (late 2008) — That was a huge event for JavaScript and web development in general! It forced all the browsers to take performance a lot more seriously, so that they could keep up with Google. JavaScript is around two orders of magnitude faster than it was when you made your original post.

    * ECMAScript 5th Edition (late 2009) — The spec has progressed significantly, helping to fix up some of JavaScript’s problems. When you wrote your post, 3rd edition was the lowest common denominator, but now 5th edition has been reliably implemented everywhere important.

    * IE6 is now dead (2010-ish?) — It’s officially supported through 2014 (XP SP3) but very few people need to worry about supporting IE6 anymore. Google has dropped support for it and Microsoft has asked people to stop using it. The next big event for IE will be the death of IE8. That can’t come soon enough.

    (This is the second time I wanted to make a list but you won’t let use use the <li> tag in comments!)

    Looking at the bleading edge of JavaScript, especially at the newer parts of HTML5, the future can be seen coalescing before your eyes. It’s just about patience as we wait for the various implementations to support the new stuff consistently enough to step out onto it. Each new browser version pushes the frontier out a little bit more.

    I’m glad you’re enjoying my JavaScript series. There are at least several more quirks I have yet to cover. I hope I don’t come off too much like I’m complaining about the language. There’s a very reasonable language hidden inside if you can see past all the warts. Like Elisp, it’s just a lot of fun to talk about the warts. :-) Only picking it up recently (now that the trend is obvious), I actually already like it better than Java, which itself holds a fairly high spot in my preferences list. So it sits somewhere above Java and below Elisp.

    Reply  |  Quote
  2. Luke Maciak UNITED STATES Mozilla Firefox Windows Terminalist says:

    @ Chris Wellons:

    Thanks, those are excellent points. Without V8 there wouldn’t be Node. Google can also probably be linked to massive push innovation rush in the browser market in general. Up until then the state of the art was whatever Mozilla and Opera folks were doing and they took their sweet time because their main competitor stood still and didn’t give half a fuck. Now that Google came out with a rapidly improved, lean and fast browser Firefox suddenly switched to to rapid release cycle and Microsoft realized releasing a security patch to IE6 once a year just won’t cut it. :P

    And yeah, I like the wart discussion. I think John Resig (of jQuery fame) used to have really interesting blot posts about this same type of stuff every once in a while and I always enjoyed them even if a some of them were going a bit over my head (talking about complexities of jQuery innards and what not).

    Oh, and the LI thing – I think that’s just default WordPress setting. For some reason it does not like list tags. I never bothered to change it.

    Reply  |  Quote
  3. Luke Maciak UNITED STATES Mozilla Firefox Windows Terminalist says:

    Chris Wellons wrote:

    You sure got a lot of hate in the comments on that old post (April 2008), even though you were generally right about JavaScript’s future.

    Yep, I think that post might have got linked somewhere like reddit or hacker news (or maybe dig – did we have hacker news in 08?). When that happens I usually put on my flame retardant suit, as not to fuel the brewing flame war. Also comes in handy when the overloaded server overheats and catches fire. :P

    This is actually why I think Steve Yegge stopped blogging about programming. Each post would yield an avalanche of hate from reddit, hn and etc. I hate when good bloggers get burned out by the inevitable internet suck. :P

    Reply  |  Quote
  4. Naum UNITED STATES Google Chrome Mac OS says:

    On Dart, was a bit flummoxed and skeptical when it was first announced and rolled out, but it has come along in the year since that article you link to (re: JS fallback)…

    …seeing a HelloWorld blow out to that much code is alarming, but consider that most JS web apps include a boat load of library (jQuery, AMD, Bootstrap, etc.…) code, it’s not entirely out of line. And given that JS is the lingua franca of client side scripting, JS output is to be the norm for the foreseeable future.

    After dabbling (and some significant production work in Node JS / Coffeescript), uncertain that Dart is a lesser option — yes, there is a lot of goober-ness in the language that I don’t get, but the integrated web application focus is appealing. Recently bought a book and have been learning — if you can push the quirky ugliness aside, Dart does remedy the short fallings of JS, and might be more desirable as a more structured solution than CoffeeScript or other library soup alternatives.

    Reply  |  Quote
  5. Rebecca CANADA Opera Linux says:

    I think that this is a damning testimonial to the sorry state of software development today. We have not made any real progress since 2008.

    JavaScript is inferior to just about every other mainstream language in just about every way. The only benefit that JavaScript has is that it is available in almost every web browser installation. Other than that, there is nothing good about JavaScript.

    As a language, JavaScript is very inconsistent, and it is missing many basic features that users of other languages take for granted. The library of classes offered by most implementations is extremely limited and awful. The development tools are just plain bad in most cases. And that’s just the beginning of what’s wrong with JavaScript!

    Any good news we hear about JavaScript always comes down to it catching up to where C++ was in the late 1990s, or where Java was in the mid 2000s, or where C# was in the late 2000s.

    It’s not “innovation” when JavaScript now only performs poorly, rather than too damn slow to be usable. Nor is it “innovation” when JavaScript debuggers allow for stepping through code. It’s merely JavaScript catching up to where the rest of the industry was years, or even decades, ago.

    It’s just not something to be proud about, especially when it’s all happening 18 years after JavaScript was first released!

    Reply  |  Quote

Leave a Reply

Your email address will not be published. Required fields are marked *