CodeRunner: A Generalist’s Swiss Army Knife

Working as a maker at Atomic Object means being a generalist. Generalists must be able to quickly move between projects, languages, and tech stacks. We are expected to quickly pick up new languages and technologies–drawing from our expertise in the technologies that we already know well.

One tool I’ve found useful in picking up new technologies (or just trying things out) is CodeRunner. CodeRunner bills itself as a “code editor for Mac.” It’s an editor that’s preconfigured to build/run code in a variety of languages. In this blog post I will describe some of its features and cover how I’ve used it in my work.

CodeRunner gives users a simple editor, a builtin web or terminal console for seeing code output, and the ability to run code. That’s nothing new, but where Coderunner really shines is out-of-the-box simplicity and execution.

When starting CodeRunner you’ll immediately notice a “Languages” drop down in the upper left—these are all the supported languages you can program in. All you need to do is select your chosen language, and start programming. This is especially nice for compiled languages like Objective-C, where you’d normally have to start up XCode or AppCode and create a new project or sandbox before you can start.

coderunner

The above screenshot demonstrates a simple program I wrote to play around with some of Node.js’s file I/O operations. The languages list is expanded, and the output of the program is displayed in the console on the bottom. A sharp reader will notice that there are REPLs provided for many of the supported languages, however:

  • It’s nice to have the editor instead of just a REPL in a terminal.
  • CodeRunner lets you open two tabs (e.g., one file in Objective-C, another in Swift) and easily work on both languages in parallel.
  • The barrier to entry for compiled languages is lowered drastically. A brand-new developer can pick up CodeRunner, choose C++, and they will be given a template containing the main function, iostream include, and using namespace std statements.

Another great feature that surprised me is code completion! You won’t see this in your basic REPL:

completion

Syntax highlighting and basic runtime statistics (CPU, memory usage) are also supported. If you’re a web developer and you sometimes find working in your browser’s developer tools cumbersome, CodeRunner supports HTML, Javascript (Node.js and browser), and jquery out of the box. When writing web code, the console can be changed to a web output:

html

While all of these features, taken separately, are available for free, CodeRunner sets itself apart by making it completely painless to sit down, choose your language and just start coding. I’ve personally used it for:

  • Learning new languages/libraries.
  • Simple real-time coding in presentations/workshops.
  • Winning programming arguments with co-workers. :)
  • Comparing solutions in two similar languages, specifically Swift and Objective-C soon after Swift was released.

CodeRunner costs $14.99, and to my mind it’s well worth the price. I’d love to hear any uses or experiences you have had with it.