Last week I gave a talk at FrontTrends 2010. Here's the code from my talk, and a brief summary of it.
- Write a test
- Watch it fail
- Pass the test
- Remove duplication
Then I fired up Emacs and spent the better part of an hour live coding, TDD-ing the start of a live search jQuery plugin. The sample code is available on GitHub, but heed this warning: About half of this code was written "before a live audience", and the rest was prepared in order to show the final demo (which I failed to do anyway).
The code is only the start of a plugin, and isn't actually functional for anything else than displaying suggestions. The most important part of the presentation was not the code itself, but rather the process of writing it - guided by tests. So take the code for what it is. Instructions for running the hackety Node.js server and testing the whole thing is available on GitHub.
How did it go?
There was a surprising amount of people on my talk, and I want to thank you all for showing up! Only a few have voted for the talk so far, but judging from what they had to say, people had a good time.
I actually messed up my final demo, which is to be expected when one sets out for a full hour of live coding, but I don't think it really mattered. The demo was mostly for a small wow-effect as the topic is a bit dry on its own. It seems people got the message despite some technical issues. After the presentation it hit me that my error was to omit jquery.js when concatenating the scripts towards the end.
Questions, questions, questions!
Marcin Kasperski has posted a very nice summary of FrontTrends 2010, including a very flattering review of my talk, check it out! (It's in Polish, but Google translate does the job). Thanks Marcin!