Mark Pearl

I recently read a post by Johannes Brodwall titled “Forget Clean Code, let’s embrace Compassionate Code”. I recommend it as a read because it made me think, and thinking is good!

First off, for those not familiar with the concept of Clean Code it was popularized and promoted by Robert C Martin (aka Uncle Bob). When I read Johannes’s post these are the key points that came across:

Summary of Points

  • Johannes has invested a considerable amount of time in becoming technically excellent and understanding clean code
  • Early on in his career he would get upset when others did not agree with him on coding practices
  • He has had disagreements with others on how to write clean code and this has impacted the opportunities to create meaningful friendships with them
  • He has found many other “clean coders” have had disagreements with those around them on what clean code is which has introduced friction in their teams
  • We can get led astray around the concept of clean code because it can make us loose focus on other more important things like the people

An Interesting Transition

The post then takes an interesting turn, Johannes says (I’ve added some comments in brackets to fill in the gaps)… “Only when he (Uncle Bob) writes something that I strongly disagree with, does the hunch about Clean Code became clear…. in light of @unclebobmartin’s recent tweets (around politics and amnesty international) , ideas like Clean Code have started creating a bad taste in my mouth. Let’s just say “code”, eh? I’m officially instituting dirty code Monday’s to remember to question dogma, tribalism and things-before-people mentality…. I deeply disagree with his stance on this political issue. I respect that some people value rules and principles higher than individual fates”… at this point Johannes makes an interesting transition back to technical practices*… “Bringing this back to code: I don’t believe we should use TDD because it’s a professional obligation.” and so on.

Being Non-Judgemental & Discerning

Why am I blogging about this? I’ve recently spent some time trying to understand the concept of psychological safety in a team space. One of the ingredients around creating psychological safety is to not be judgemental. I’ve always wondered what this meant. Being able to judge whether something is good or not seemed useful - good code or bad code, good action or bad action and so on…

If being non-judgemental is important in creating psychological safety, does it mean we loose the ability to tell good from bad?

It wasn’t until I came across post by Raj Raghunathan titled Don’t be Judgmental, Be Discerning that the penny seemed to dropped for me. Being discerning means you keep the difference on just the one dimension, it means you can look at code and go… this code is good because of X or clean because of Y but not make any judgement beyond that…

Compare this to being judgemental where dirty code == bad programmer == bad person.

My Closing Thoughts

While I have read Johannes’s points around the challenges he has had with working with others and promoting clean code I don’t believe it is because the concept of clean code is a bad one. I worry that in taking offense to Uncle Bob’s political views Johannes has made the leap to taking offense to anything Uncle Bob… I worry he’s moved across dimensions, it feels like it’s moved from being discerning to being judgemental.

In reflecting on the experiences he has shared it has just highlighted to me how as a industry we need to have balance - software is a team sport, the people element is key to being effective. Investing time in knowing how to write clean code is valuable… investing time in learning how to work with people is also valuable.

So I agree with Johannes’s call to embrace compassionate code. I also really hope that the code is clean.

blog comments powered by Disqus

Want to get my personal insights on what I learn as I learn it? Subscribe now!