Thursday, November 21, 2013
JQuery Meetup & Unit Testing
That's always a good thing. TheHackerCIO believes in continuous pushing out of the comfort zone; pushing the edge-of-the-envelope.
I really like these Meetups, regardless of the underlying technology, because of the method of presentation. Natalie MacLees, who runs them enters her sample code and runs it all live. So any errors have to be resolved on the fly. This is amazing productive of insight. I love it. Last nights showed implementation of a slider.
The second interesting technique she uses is this: after the code works, she begins showing variants. For instance, you could have written this line in a shorter idiom, in this way. See the results! It's way cool. Last night she had at least three successively more condensed iterations.
The second presentation was on QUnit, a TDD testing framework for JS. I picked up one point about TDD worth reflecting on, since I don't do that many bug fixes these days, which was that prior to fixing a bug, you should write the test showing the code Red. Only then should you fix the bug and change state to Green. Thus you now have a regression test guarding against inadvertent reintroduction of the bug.
My own problems centered around getting jQuery installed on my follow-along PC. My sublime editor had to be reinstalled, then I had to get jQuery downloaded. So I fell behind in entering the code along with Natalie. But she promised to post a link to the code, which I will add here, when I see it.