Saturday, July 16, 2011

Thoughts on "The Clean Coder" by Robert Martin

I recently finished The Clean Coder by Robert (Uncle Bob) Martin, and frankly, I loved it. I've been a fan since I first read the Newkirk and Martin book on XP. Most of Uncle Bob's books deal with the technical issues of writing good code. The Clean Coder is a departure. Rather than talking about how to code, it takes on what it means to be a "Professional".

I love the book because it is unflinchingly honest, even when that is painful. The chapter on Saying "No" is the hardest read, not because it is poorly written but because it hits so close to home. The basic message is that, as professionals, we have an obligation to say "no" and mean it when confronted with unreasonable demands. Our usual response of "I'll try" is, basically, a lie. It's not a lie in that we won't try, but rather in the fact that we know good and well there is no way its going to happen; but we go along to avoid conflict. Business makes plans based on what they think are real commitments, only to be let down one more time.

Anyway, as I read this I reflected on the the past couple of projects I led that were, ahem, less than stellar successes. A couple of instances:
  • Toward the beginning of a project, we got a handle on the general scope and functionality. I very painstakingly worked out an estimate of 18 months. This figure came out of 3 disparate methods, including one from a piece of commercial estimation software. Given that the 3 results were very similar, I thought I had done a good job. First meeting with my boss, I presented the results and was told, "that will never fly. It has to go operational within the next 9 months." They countered that they would add resources (guess what position is still open a year and a half later?). "I'll try", followed by a hellish year and my eventual resignation after the project scope, re-envisioned for the n-th time, was still in free-fall.
  • Well into another project (different employer) I suddenly had a project manager foisted upon me. As I was leading development, managing staff, doing budgets and the PM role, this should have been a gift. Instead, I saw it as a turf grab, and we went through a couple of months of jousting before we came to an understanding and started working collaboratively. Development pretty much stopped for a few weeks while I pulled together detailed project history and a raft of estimates. The PM dumped it into MS project and we finally came up with a defensible estimate of completion. He was sure that having the details documented would show management the true state and we could all move forward to a quality conclusion ("kum-bai-ya"). Instead, this was immediately met with a rousing yawn followed by "9 months won't do. Version 1 has to be out this year" (this was September). My response was, of course, "I'll try". Three months of stress later, we pushed out a very lame, buggy version. Because the feature set was weak and it had a tendency to crash, it was a "non-successful" launch, and eventually funding was slashed for the next year, dooming the effort to the list of projects no one talks about. Oh yes, the contractor PM who I came to like and respect, was terminated less than a week before Christmas.
In looking at these, incidents, I have a three responses:
  • to cringe at the lack of success
  • a bit of PTSD (Post-traumatic Stress Disorder) recalling the feelings
  • a serious desire to never go through this again.
I had pretty much blamed the people who uttered the "That won't do". But I've reading "The Clean Coder," I have had to reconsider. In retrospect, "I'll try" avoided short term conflict, at the expense of long-term project failure and personal stress.

Honestly, if your auto mechanic said it will cost $200. for new brakes and you told him "That won't do; make it work for $10 using cardboard and chewing gum", you (and your insurance company) would not be happy if his response was "I'll try".

I'm left with the conclusion the, once again, Uncle Bob is right. Saying "No" would have caused tremendous conflict. That conflict was with people who controlled my raises, and even my continued employment. And the statements of "That won't do" seemed to have thinly disguised threat of unemployment behind it. Nonetheless, I am convinced that the Professional response is not "I'll try." Having the guts to stand behind my view, to express the reasons and not cave to the pressure, is Professional. "I'll try" is a disservice me and to my customer; by getting along now, "I'll try" hoses everyone in the long term.

As I said, the book is great because it is unflinchingly honest, even when that is painful.

No comments:

Post a Comment