Listening to Brett Terpstra interview Marco Arment on Systematic recently, I was reminded again of how useful CodeRunner is. After googling around a bit though, I realized that CodeRunner has not been reviewed or featured much in the Mac press so I thought I would put in my two cents as someone who has found it especially useful as a learning tool.

CodeRunner is a fantastic light-weigt code editor for beginners and veterans alike

CodeRunner's strength lies in its versatility and simplicity. Thirteen languages are supported, which makes it easy to experiment in C, C#, Objective-C, C++, Java, Javascript (Node.js), Python, Ruby, Lua, Perl, PHP, AppleScript and Shell Script. CodeRunner also supports essential code editing features like syntax highlighting, code completion and bracket matching.

The advantage of using CodeRunner over a more full-featured IDE is not its features so much as the speed and ease with which it allows you to test your code. The app is fast and has minimal chrome, preferences or other distractions that might lead to fiddling. CodeRunner is reminiscent in some respects of the "distraction-free" writing environments that are all the rage. Like those apps, CodeRunner reduces friction so you can get the code out of your head and onto your Mac where you can test it and iterate quickly. There is not anything that CodeRunner does that you could not achieve in a full-featured IDE like XCode, but using XCode for testing out discrete chunks of code is like pulling out a blow torch to light a cigarette -- it's more tool than you need to get the job done.

CodeRunner has become my programming scratchpad. As I was writing my Status Board Electricity Price Tracker post about the code I wrote for sending predicted and actual electricity prices to Panic's Status Board app, I realized that the URL pattern from which I was pulling the pricing data worked for dates all the way back to January 1, 2007 -- over 120,000 hourly predicted and actual data points all waiting for me. Useful? No. Irresistible? Absolutely.

I had already figured out how to pull the data from ComEd's web site, parse it and write it to a CSV file for any given day. To pull the data for each hour of every day since January 1, 2007, all I would have to do is define the start date, end date and then execute a loop over each date during the period. Better yet, I would get some more practice with NSCalendar, NSDate and basic flow control.

I started out in XCode, but it was laborious to open XCode and far more than I needed to run such a simple command line program. In contrast, CodeRunner was snappy and allowed me to iterate my code quickly. I would build up a block of code, set up some NSLog statements, run it and either respond to error messages or move on to the next step. CodeRunner built my code quickly and gave great feedback along the way. Before I knew it, I had downloaded all of ComEd's price data back to January 1, 2007 and built myself a Numbers chart that would make Horace Dediu proud. I highly recommend CodeRunner whether you are a beginner like me or a veteran.

CodeRunner by Nikolai Krill is available in the Mac AppStore for $9.99. The electricity price downloader I put together with CodeRunner is on GitHub.