Once upon a time, developers fretted over making their code lean and fast.
To excel in those days of scarce hardware resources, developers had to master algorithms, outsmart compilers, and perform death defying feats with pointer arithmetic.
Oh, how things have changed…
Now hard drive space is cheaper than water, memory sticks grow on trees, and you can’t buy a digital watch that doesn’t have multiple cores. By contrast, developer salaries have continued to rise steadily over the years, thus making the time a developer spends on a task the most expensive part of the software equation.
This explains why developers who would have been idolized by their peers less than a generation ago for their low level, bit-twiddling prowess are now often scoffed at for their sins of “premature optimization”.
As a result, today’s thought leaders spend considerable effort figuring out how to stem the relentless tide of software entropy, a goal that loosely falls under the umbrella of maintainability.
Knowing how to write a bubble sort or explain the difference between a depth-first and symmetrical traversals in search algorithms might earn you some geek “street cred”, but it is unlikely to improve your daily life much if you’re like most other developers. For example, it won’t help explain to a pissed off CIO why that simple modification to your department’s favorite legacy app just took a week to complete and introduced two new bugs in the process.
What developers really need to excel today is some insight into how to write code that is an order of magnitude easier to grok and modify.
This is exactly what Bob Martin (aka Uncle Bob) attempts to do in his book Clean Code (which happens to be my March book). He examines code expressiveness from a variety of angles, such as naming, composition, code length, commenting, and formatting, and applies the same rigor to reducing the amount of time it takes to understand code that was once applied to improving algorithm performance by computer science giants like Donald Knuth.
Although Uncle Bob prefers the craftsmanship analogy to describe our profession, most of the recommendations in the book suggest to me that coders should spend more time thinking like writers.
This resonates with me because I often feel more like a writer than an engineer at the end of the day given the amount of mental energy I spend picking just the right variable, method, and class name or how much effort it takes to organize code at the just the right level of abstraction so that it effectively conveys the meaning of the work being done.
It also explains why the industry has been so enamored these last few years with things like Fluent Interfaces, DSL’s, and executable specifications, which all attempt in some way to bring the world of code closer to the world of natural language.
All of this makes me wonder if the Back to Basics meme that was floating around the blogosphere over the last few years is really the most productive direction to take if we want to improve the state of our profession.
Rather than pushing Knuth’s the Art of Computer Programming, should we instead be handing out classic pieces of literature to new developers as a way to fine tune the natural language portion of their brains? Would this do more to help eliminate the ubiquitous coding monstrosities like the one colorfully illustrated in this Uncle Bob video?
I’m not saying we need to start recruiting from English instead of Computer Science departments, but it is an interesting thought.
Popularity: 2% [?]