A Foundation to Build Javascript On

Like probably quite a few others I’m doing more Javascript of late, both professionally and at play. It’s not just the whole buzz around it, all the way back to Jeremy using Javascript for Good not Evil but I moved away from doing backend development when I moved jobs, Javascript is most definately in my client side job remit.

As an avid reader I’ve got hold of a few good quality Javascript books that have come along and was on the lookout for more when I came upon Foundations of AJAX from Apress’s black and yellow experts voice series. I haven’t read enough to give a full conclusion but I’ve been impressed with other books in the series and it looks promising so far. A few chapters did stand out (I jumped in and read them first) that had little to do with AJAX, concentrating instead on setting up a proper Javascript development environment.

I’m not a fan of bloated IDEs so the lack of one for Javascript doesn’t bother me as much as it does some. However debugging by browser is a pain for simple scripts, never mind larger applications. Firefox’s Javascript Console is mighty handy here, as is the DOM inspector and the view rendered source extension. There is also the Windows Script Debugger but I personally haven’t had much luck with that as yet.

Projects should have documentation and code should have comments. But it’s time consuming (honestly). Automatic generation of docs from source comments both makes you comment more efficiently and comprehensively and saves time. Everyone’s happy, at least as long as they are using the JSDoc perl application to do just that. Anyone familiar with Java will have come across JDoc and the name isn’t the only similarity. It’s now installed and ready to be used next time I write any Javascript.

Another area of interest recently has been application design, analysis and methodology, so I’d come across the idea of test driven development before and experimented briefly – but not with Javascript. The idea is that you write tests that can be run automatically on your finished code before you write the code, it makes you design more which cant be a bad think. Anyway, Javascript has JSUnit, a nice unit testing framework. Again, installed and ready to give it a whirl.

Hopefully this brief list will prove useful to anyone else making more use of Javascript recently and looking to be more productive. Anyone else with any other useful tools do post a comment, or is their a mythical application that you just wish existed to help you with your Javascript woes?