Codebook is an interactive programming environment I developed to make coding a little more fun by improving feedback and interactivity. I developed it in 24 hours for the HackU programming competition; it won first place. Codebook is an implementation of an idea from a fantastic talk by Bret Victor titled “Inventing on Principle”. Bret was kind enough to give CodeBook his blessing and let me post my implementation and it’s source.
More after the Jump…
There have been several implementations of Bret’s idea since his talk went viral, however mine is unique in that it is the only 3rd party implementation I am aware of that has the canvas inspection feature. This feature highlights the line of code responsible for drawing the element your mouse is hovering over. You can try it out by clicking the inspect button and hovering over the canvas. It’s not the ideal UI for the feature, but, hey, I made this in less than 24 hours.
Codebook takes advantage of web workers to process the user’s code in JSLint, an excellent code quality tool by Douglas Crockford. This allows the browser to remain responsive by parsing the code string in a worker thread. An added benefit of parsing the user’s code is that I can avoid submitting faulty code to the browser that would ordinarily break the preview window on the left.