Posts

Showing posts from January, 2013

Unit testing JavaScript

I am well used to writing unit tests for java code (although most project managers don't really go for it), but had not come across something decent to do this for JavaScript. QUnit appears to be just the job. I don't think it is just me, but I seem to write pretty badly structured js. Coming from java this architectural stuff is mostly forced on you, but not in js. However once you start to write unit tests for your code you start to think about laying this all out better. I read through the intro. Then I read this simplified getting started. And then I wrote some tests for my own code. Altogether this took me just over an hour. A worthwhile investment. This was of course the point where I realised that my code was not particularly testable. Ah well, I will refactor it from now on with this purpose in mind. Next off I am going to go through the cookbook  as it seems to address some of the issues that I want cleared up before I commit fully to this - things like manipulat

Code Academy

There are a bunch of new online learning tools becoming available at the moment. Some are based around the idea of a university style education (http://www.udacity.com/ and http://en.wikipedia.org/wiki/MIT_OpenCourseWare for example), others have a more hands one goal of teaching you how to program. One of the nice programming ones is Code Academy . They have a short list of courses based around programming. They cover areas like JavaScript and JQuery. They have a nice online editor where you carry out the practice questions. There is a clever engine behind this which allows you to get the answer right in a number of ways - it is not just making sure you did exactly as instructed. Useful messages when you go wrong and the whole thing is gamified   To make the rat brain in us all happy :) Well worth a try if this is you thing - or if you would like it to be.