A/

/ Have JavaScript, Will Travel

The technology of the web is maturing. However slowly and clumsily, it is maturing. The web of today looks nothing like the web of ten years ago. Most notable are the advent and widespread adoption of Web Standards, and more recently the mushrooming popularity of JavaScript due largely to Web 2.0 mania.

The trouble though, is that almost nobody knows how to program in JavaScript. Relative to the number of web designers out there (those who only know HTML and CSS) there are very few front-end web developers (those who know HTML, CSS and JavaScript). And this isn’t wild hand waving. I know it to be true because I do a lot of interviewing of potential candidates where I work. Nearly everyone that I meet says flat out, “I don’t know JavaScript.” And those that say they do, admit to only being able to work with existing code, i.e. changing a value here and there. Very few can code applications from scratch. Yet that’s exactly what’s needed, which means there’s a shortage of qualified people.

You may be thinking, “isn’t JavaScript something better left to real programmers?” The answer is a resounding no! First of all, JavaScript programmers are real programmers. This ain’t 1996, and this ain’t your daddy’s JavaScript. Things have changed over the past ten years, a lot. Secondly, good programmers specialize. Simply put, the more time you invest in understanding the ins and outs of JavaScript, the better you’ll be at it. JavaScript is actually unique from other programming languages in that it’s implemented across a slew of competing browsers (it’s the only browser scripting language available) and is deployed across more computers than any other programming language could ever dream. The very fact that competing browser makers write their own implementations of JavaScript means there will be differences. Knowing those differences and the inevitable quirks that each implementation has is a definite asset to any aspiring JavaScript Code Ninja. To say nothing of the time, hassle and security risks that knowledge will save you.

So if you’re interested in jumping onto the JavaScript bandwagon, here are a few things to remember:

  1. Don’t learn by viewing source, learn from the experts. Here are a few starting points: Douglas Crockford’s JavaScript, Christian Heilmann’s Blog, John Resig’s Blog, YUI Theater, JavaScript articles on SitePoint.
  2. Find out what Unobtrusive JavaScript is and write all your code that way.
  3. Avoid copying and pasting, type everything out long hand. This is a self-teaching technique I often use. Rather than using the clipboard, I place both windows adjacent to each other and retype the line I want. This forces the brain to better absorb the information. Trust me, it works if you get into the habit of doing it.
  4. Invest in a few good books. Here are a few to start you off, JavaScript: The Definitive Guide, JavaScript: The Good Parts, The Art & Science of JavaScript (full disclosure, I co-authored that last one… hey who ever said self-promotion was a bad thing?)
  5. For the love of all that’s good and decent, install Firebug. Also know that the debugger that comes with MS Office (yes, oddly enough there is one in there) is orders of magnitude better than the one you can download for free from Microsoft.

Now get coding!

–30–

Read more from the archive.