2007-09-21

"Javascript doesn't suck"



About a year ago I started a post for which that was to be the title and never had time to finish it. I'll rephase, Javascript sucks! It's a POS language frought with inconcinstancy and incompatibility. Where did this reversal come from? Recently I've been on loan for a project to implement a new AJAX feature. I'll admit that I'm not a Javascript/AJAX ninja but I certainly didn't expect an onclick to break in IE or a onreadystatechange to break in Safari. More than anything my critisism of Javascript isn't so much regarding the language itself (though I've got some winners) but rather the vendors, MS, Mozilla, Apple, etc, for their poor support and interopability. AJAX is a prime example, there is absolutely no reason for a 20+ line try{} catch{} to get a XMLHttpRequest object, none! And yet, we've all written one (at least one) at one point. Add to that the lack of good debugers and it just goes downhill from there. I could probably continue my rant here but I'm going to try to control myself and get back to putting the finishing touches on the afforementioned "loaner" project.