Monday, July 17th, 2006

The Importance of Maintainable JavaScript

Category: JavaScript, Programming

There are three levels of Javascript programming that developers should go through:

  • beginning programming with popups and roll-overs everywhere
  • advanced Javascript coding with site-enhancing functionality and loads of bells and whistles
  • writing maintainable Javascript

That last one throw you for a loop a bit? Well, read on…

It’s one thing to develop code that runs well and that does the job, but without structure and formating as a practice in your development, things can get pretty scary pretty quick. Even this new article from Vitamin reinforces the fact.

Forums and mailing lists are full of requests about Ajax, DOM Scripting and how to use this or that library or effect. There is also an extraordinary amount of scripts, libraries and effects being developed and showcased, and the blogs and news sites specialising in scripting hardly have time to look at the demos properly before they are on or and making the rounds from these sites.

Times to celebrate for those who have hung on to their skills when the DHTML craze subsided in 2001 and JavaScript became persona non grata on your CV as a main skill.

They talk about not only some of the benefits of having well-maintained scripts (making the user’s life easier), but some techniques to help you keep things neat in your own work. They make suggestions like “Keep your syntax and structure clean and logical”, “Seperate textual content and code” and “Comment your code” (funny how that last one pops up so often, eh?)

All in all, they give you eight different tips on how to “keep it clean” when it comes to creating code, all with descriptions/explainations and code examples where appropriate.

Posted by Chris Cornutt at 6:48 pm

3.6 rating from 25 votes


Comments feed TrackBack URI

Yet another scale for grading developers…LOL

I am wondering; is these scales for those who come up with the levels (positioning themselves as top-notch programmers) or for the rest of the dev-community? Eitherway, the top of the scale is the level of knowledge possessed by those who invented it. (!?) If a developer is aware of a higher level than he/she belongs to that level; and knows of levels below him/her.

Comment by Hakan Bilgin — July 18, 2006

Just for the record: The scaling has nothing to do with me or the article. I’d actually wished people would write with maintenance in mind from the beginning and skip the whizz-bang stage.

That said, it is normally the way a JavaScript developer evolves, historically, not from a skill point of view. I’ve seen a lot of amazing DHTML/Visual Effects I wouldn’t know how to do, but my first obstacle would be to find a reason why I should do it.

Comment by Chris Heilmann — July 18, 2006

Leave a comment

You must be logged in to post a comment.