“The Only Way to Go Fast is to Go Well”

This morning I started the Clean Coders video series by Uncle Bob Martin. The video is a fun mix of gravitas and quirky-ness that anyone who’s had the opportunity to hear Uncle Bob speak in person will recognize. His stories of working on old systems or watching teams deal with crappy code can be amusing but also carry some important lessons.

The first video in the series answers the questions of “Why Clean Code?” and “What is Clean Code?”. He states that “the only way to go fast is to go well” and uses the analogy of a sushi chef that I really enjoyed. If you’ve been to a Japanese steakhouse it’s easy to be amazed at how fast the chef slices and dices his way to your entreé. But if you look around as he or she serves you your perfectly presented meal you’ll notice that their work place is impeccable. The chefs clean up as they go and then have a clean slate for the next job. Coding should be the same, if you clean as you go and practice over and over, you’ll be faster, you’re code will look good, and you’ll be that much more prepared for what’s next.

When it comes to answering the question of “What is Clean Code?” Uncle Bob first explains four symptoms of bad code: rigidity, fragility, inseparability and opacity. Rigidity is revealed when a single change in a system causes dozens of changes and adjustments. A fragile system is one which will break in many places if you change just one thing. Inseparability means there are modules that can’t be separated and re-used for other systems. Finally, opacity means that the code doesn’t communicate the author’s intent, either because of poor naming or structure.

Uncle Bob ultimately answers the question of “What is Clean Code?” by deferring to what his colleagues have said. Bjarne Stroustrup uses the words “elegant and efficient”, Grady Booch used “simple and direct” and Ward Cunningham said “each routine you read turns out to be pretty much what you expected.” It all sounds so effortless, and whenever I’ve come across clean code it definitely looks simple— but that of course is the trick. Those who’ve disciplined themselves to practice over and over have put in the time to make it look effortless. And just as watching Michael Jordan shoot effortless jump shots inspired me to head down to the park and practice free throws, seeing really well-written code definitely inspires me to keep on learning and keep on practicing.