Pinderkent

Pain and glory from the trenches of the IT world.

I still dislike JavaScript, and likely always will. It has some pretty fundamental flaws.

Posted on Saturday, January 24, 2009 at 2:56 PM.

There was a recent thread of discussion at Reddit asking who initially disliked JavaScript, but "later realized it's actually a pretty cool and very unique language." I must say, I disliked JavaScript the first time I had to work with it in the mid-1990s, and having used it extensively since then, I still have to admit that I dislike it.

The only interesting thing about JavaScript is its support for prototype-based programming. But in this regard, it is neither unique nor is it particularly innovative. Much of that credit would need to go to Self, which predates JavaScript by nearly a decade. JavaScript has borrowed ideas that other pioneered, but unfortunately many programmers aren't aware of that, and are mislead into thinking that JavaScript is the original source.

Aside from that, JavaScript doesn't offer anything spectacular. For instance, functional programming languages had been offering first-class functions for decades before JavaScript was developed. Likewise, its syntax is clearly based on that of C, which itself has been around for quite a while. Its regex support is unremarkable. And typically being embedded within a Web browser is more of a hindrance for it than anything else.

JavaScript does offer many drawbacks. One of the most significant is that it is a dynamically-typed language. Some people mistakenly believe that this is a benefit. They say it allows them to develop their code faster. And in a sense, that's true. They may very well produce more code, but that's just because there's no compiler there to point out their numerous coding mistakes, and to force them to fix the mistakes before they can run their code. So they code they produce is heavily flawed, and we often end up with Web sites in production that have numerous problems that are only detected at runtime. Unfortunately for all involved, it's usually customers and clients who detect these problems.

Another major problem with JavaScript is its performance. It probably doesn't help that most implementations are browser-based. Web browsers themselves aren't often known for being fast pieces of software. So it's not unexpected that a scripting language running within the browser is lacking in performance, as well. And it's only now, after nearly 15 years, that's we're beginning to see better-performing JavaScript engines like Tamarin and V8 become available. That's an awfully long time in the world of computing.

Within the Reddit thread, many people said that their favorite things about JavaScript were libraries like jQuery, Prototype, and Ext JS. First of all, those have little to do with the JavaScript language itself. And they're not especially innovative, either. All they're doing is patching up the numerous flaws that make JavaScript-based and Web browser DOM-based development so awkward in the first place. They bring only an illusion of productivity, rather than actual productivity, because JavaScript-based development in the browser was so terrible and unhealthy to begin with.

As we can see, JavaScript can generally be considered a technological failure. That doesn't mean that it isn't widely used; it clearly is! But we should not mistakenly consider it to be an innovative nor a well-designed programming language, for instance. Of the people I know who like JavaScript, most of them are very ignorant about other programming languages and environments. JavaScript only seems acceptable because they don't realize how flawed it is in so many critical ways.

Permalink: http://pinderkent.phumblog.com/post/2009/01/i_still_dislike_javascript_and_likely_always_will_it_has_some_pretty_fundamental_flaws
Share:
Feeds
  • RSS 2.0 Feed
  • Atom 2.0 Feed
Tags
Archives