Methadone 1.0 with Awesome Tutorial

April 11, 2012

Methadone is the ultimate command-line library for Ruby apps. All the power of OptionParser, none of the verbosity, with a smattering of tools to help you write amazing apps right from the get-go. In seconds, you have a fully functioning skeleton of an app, with integration and unit test coverage, documentation, and in-line help. I created most of it while writing [my book][clibook], and have been feverishly polishing it since the book came out.

Today is its first official release at 1.0. Woot!

'Cover for the Methadone Tutorial iBook'

I’ve also released a tutorial as an “enhanced” iBook, available now from the iBookstore as a free download. This isn’t just a big ream of code and text, but a step-by-step walkthrough, with screencasts, on how to use Methadone, along with some detailed discussion on some of Methadone’s more useful features. It’s all presented beautifully as a “textbook”-style iBook that looks great on an iPad 1 and stunning on the new iPad, thanks to iBooks Author and the retina display.

Read the tutorial, read the RDoc, install the library, and feel free to submit patches.


A Protocol for Code Reviews

April 02, 2012

Anyone have a (formal / step-by-step) protocol for code reviews?

Yes, I do. At Opower, we were pretty serious about code reviews. We didn’t review every commit, but we did review a lot, and, after a while, fell into a pretty decent routine. This is an adaptation of that that I think is pretty decent.

The Nine Facets of an Awesome Command-Line App

April 01, 2012

When creating the outline for my book (now officially published and in print!), I decided to organize it around the nine facets of an awesome command-line app. Each chapter focuses on one of these facets. They state that an awesome command-line app should:

  • have a clear and concise purpose
  • be easy to use
  • be helpful
  • play well with others
  • delight casual users
  • make configuration easy for advanced users
  • install and distribute painlessly
  • be well-tested and as bug free as possible
  • be easy to maintain

In this post, I’ll illustrate each of these facets (along with a test of the tenth chapter on color and formatting), via a code walkthrough of a simple command-line app I created for work.

Trailer for my Book

March 19, 2012

The trailer for my book, check it out:

It’s a nonsensical journey through the computer, ending on the command-line. It’s got drama, special effects, and a stern soundtrack :)

Quote: Mocking and Dynamic Typing

February 22, 2012

When mocking and dynamic typing travel in the same cart, the riders believe nothing can stand in their way. Their movements become headlong - faster and faster and faster. They put aside all thoughts of obstacles and forget the precipice does not show itself to the man in a blind rush until it’s to late.

Mountain Lion Does Not Concern Me

February 19, 2012

Apple has just announced Mountain Lion, the next version of OS X, due out in the summer. Although it’s more of an incremental upgrade than Lion was1, one of the most interesting features is Gatekeeper. Gatekeeper, in brief, prevents unsigned code from running on OS X. Although it can be disabled, it’s on by default, and many feel this is the beginning of the end for users having full control of their computers. I feel the opposite: it’s not a slippery slope, and it’s actually a great feature.

Even More Clean Tests:Magic Values

February 16, 2012

In the last two posts about “clean tests”, we talked about the structure of a test, how to eliminate duplication, and how to make intent clear when using mocks. We left off with a question of magic values: Why do we seem to use them in our tests, when we know they are wrong in production code? Let’s explore that and see how to eliminate their use in our tests without making the tests hard to understand.