Pinderkent

Pain and glory from the trenches of the IT world.

"Older developers" aren't afraid of JavaScript. They just see it for the monstrosity that it often is.

Posted on Thursday, February 26, 2009 at 12:32 AM.

There was recently a thread at Hacker News asking why "older developers are afraid" of JavaScript. As an older developer, I don't usually feel fear towards JavaScript. It's more a mix of disappointment, disdain and disbelief.

Furthermore, it's not just "older developers" who see JavaScript for what it truly is. There are many younger developers who know how inherently flawed and broken it is. So maybe instead of "older developer", a more appropriate term to use would be "knowledgeable developer". Anyone who has worked with a variety of programming languages should be able to easily see the many problems associated with JavaScript.

We're all very much aware of the implementation-related issues of JavaScript. Performance is one of the most significant problems. Although there has been much in the way of improvement in this area from Google, Mozilla and Apple, the situation is still not ideal. JavaScript, being embedded within all popular browsers, has been responsible for a variety of security-related problems. Aside from such implementation issues, JavaScript has some pretty serious problems with the language itself.

One reply to the Hacker News topic mentioned earlier gives a good example involving semicolon insertion. Others have pointed out this problem, such as in the JavaScript Style - why it's important and Beware Of JavaScript Semicolon Insertion articles, both of which give similar examples. Another example of the problematic nature of semicolon insertion can be found at Wikipedia.

Developers who have used more mature languages than JavaScript don't have much tolerance for oddities like that. They're dangerous and unexpected. More importantly, it's a further example of how trying to dumb down programming technologies to make them usable by Web developers has failed us yet again. HTML parsers, for instance, have to be unnecessarily complex to handle blatantly incorrect HTML markup. Another example of catering to carelessness and a lack of knowledge is PHP's magic quotes, which thankfully will be removed from PHP 6. And as mentioned earlier, we have JavaScript's semicolon insertion, itself a "feature" that exists basically to allow for, and to even promote, careless development.

JavaScript does unfortunately have its place, but only because it's really the only practical option for client-side browser scripting at this time. Regardless, those who use it should take care. Douglas Crockford has put out some useful articles and tools to help with this. His JavaScript coding conventions article, for instance, provides some good tips. His JSLint tool is useful, as well.

Perhaps someday we'll see a stricter, more mature language widely available for client-side Web browser scripting. Although this may not appeal to lazy Web developers, that would be a good thing. Care should always be taken when writing network-accessible software, regardless of whether it's a server of some sort, or client-side scripting. Having a strict and unambiguous language will help prevent many of the problems that JavaScript exhibits.

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