Javascript: A Plea for Sanity
Look, pay attention folks. Javascript is a great, powerful little language (simillar in many respects to that other great embedded scripting language Lua). Unfortunately, due to its history, and various bits of maltreatment by some of its users, it’s gotten an absolutely filthy reputation as a language you just “copy and paste” with, and can just “hack” with (in the worst/false sense of the word).
Also, most developers simply dont care. Javascript is just that after thought language you have to use when you get down to the presentation layer on your enterprisey web application (all the SERIOUS stuff is done in C#/Java/[insert your SERIOUS ENTERPRISE LANGUAGE here]). So you just hit the web and copy and paste some code, maybe include one or more AJAX libraries here and there, and who knows, somehow get the stupid thing working.
Urgh.
That hairball of Javascript that you tangled together is someone’s maintainence nightmare. If there is any justice in the world, it will be YOUR maintenance nightmare. So if you are going to write Javascript, how about taking the time, care and attention to at least get the basics right, and code in a sensible, safe and professional way? It really isnt that hard at all, and there are some great resources out there to help you.
The very least you can do is read Simon Willisons’ presentation and notes from his ETech Javascript Tutorial. If you haven’t done any Javascript in a while, this material is gold.
If you really want to get the full lowdown on Javascript, read this book:
The 5th Edition was published in August last year, and its the single best Javascript book I’ve seen. It covers pretty much everything, the core language, client side scripting, AJAX, the works. Good stuff.
openjsan.org is the JavaScript Archive Network - “a comprehensive resource for Open Source JavaScript libraries and software”. So if you are going to reuse some Javascript code, you can do it in a modular way and not using horrendous copy and paste hack hack hack “methodology” every scriptkiddie with a modem was using back in 1995.
Other libraries you might want to check out for slick AJAX’y goodness include:
So there you have it. A list of useful resources to help you get some Javascript mojo. .