Mike Knepper

Ruby De-Railed

January 11, 2014

An early challenge in my apprenticeship at 8th Light is going to be weaning myself off of Rails and becoming more comfortable working in pure Ruby.

In his review of version 1 of my Tic-Tac-Toe app, craftsman Josh Cheek made a comment that surprised me: “Design sense follows what is common in Rails, which I think is problematic, and probably most here would agree with me (though not necessarily in the preferred alternatives).” This caught me quite off guard, as one of the things I was most proud of in the app was my adherence to recommended Rails principles and practices. However, as I paired with my mentor Rylan yesterday at Waza (8th Light’s weekly work-on-whatever sessions on Friday afternoons), I started to see how beneficial working in pure Ruby will be.

A popular phrase in Rails is “convention over configuration,” referring to the idea that a large portion of web applications (80%? Pareto, anyone?) work pretty much the same way under the hood, and the remaining, smaller percentage of the app is what distinguishes it from everything else. This is a clever thought and was certainly helpful for me as a beginner (TSL recognized the need for new developers to see something up on the page–that early satisfaction creates a hunger for more). However, it’s also dangerous because it allows me to take things for granted and rely on “automagic” methods and processes without understanding how they actually work.

I must keep in mind that Rails is only a framework for web applications written with Ruby. As such, Rails is going to have biases (both subtle and explicit) towards certain ways of doing things. I don’t hold that against Rails–any framework will inevitably have biases, and in fact I believe there’s value in it being opinionated and encouraging a particular approach over others. But as I pursue mastery in software development, I need to understand the tools available to me and be able to select the right tool for the job.