Anti-Pattern: Fear Driven Development

15 June 2014 | 4

Over the years I’ve worked for a lot of companies and on a lot of different teams and one of the most common issues I saw was fear of the code that was written. I’d like to expose you to this issue in detail and propose how you can work better and make your end result much cleaner.

What is Fear Driven Development?

Code is complex, especially when you’re working on a big project. Understandably, when you’re a new developer, it’s very scary to join up on a project like this and if you’re being asked to add new features you might be hesitant to fix issues you come upon. Most developers leave the code as is, not daring to reformat, restructure, or fix even the most minute issues. They’ll just do the bare minimum. This is what I call fear driven development; the fear to improve upon or repair code out of fear of breaking other parts of the code. As I’ve seen in my experience, this is a vicious paradox. The more fearful a developer is of breaking the code by leaving it untouched, the more likely the code will break.

As a clean coder, I’ll note that fear driven develop also acts in direct contest to the idea of never accepting a broken window. If a developer leaves behind the issues they notice in their code, it could eventually break the code. Even if an issue doesn’t break the code, the code slowly turns into a patchwork of different ideas and perspectives, creating a code that is bound to decay.

Fear Driven Development

How to avoid Fear Driven Development

The easiest way to avoid fear driven development is to have no fear. Your goal should be to make every line of code perfect, whether you wrote it or not. This doesn’t mean arbitrarily tearing apart all of your colleagues’ work, talk to them. Ask them why they wrote this method in this way, see if you can find a common solution. This conversation isn’t only socially appropriate, it will also help you form a ubiquitous language within your team. This way, no matter how many developers are working on the code, it will look like one guy wrote the whole thing.
I know it’s always difficult to sound like the guy who is complaining, but focusing on the cleanliness of your team’s code will strengthen its quality, solidify its design, and improve both your knowledge and your colleagues.

Subscribe now

to be informed when my Java Clean Code Video Course launches and to receive a 20% discount. You will also gain access to accompanying course material in the form of printable pdf's and receive another free Java tutorial after you have subscribed. Enter your email address to get these exclusive offers now.

I respect your privacy. I'll NEVER sell, rent or share your email address. That's more than a policy, it's my personal guarantee!

4 thoughts on “Anti-Pattern: Fear Driven Development

  1. Avatar for Marcus Biel Divine says:

    I am gonna fail anyway so I will die trying. I like the idea of not being afraid to break things to make your code better. “The easiest way to avoid fear driven development is to have no fear.” – on point Marc

  2. Avatar for Marcus Biel Rich Markle says:

    I was a developer on a very popular dating site. My boss was very strict about conventions, he and my lead would give us certain design patterns they wanted applied in different situations. And we held weekly code reviews. An amazing thing happened. After 3 or Months, it became harder and harder to discern who had written a piece of code. We all tended to approach things the same way. This made new features easy to add and bugs easy to fix.

  3. Avatar for Marcus Biel Alex says:

    Wow. I must say that’s a heart mover. I need to integrate this in me. Thanks marcus.

Leave a Reply

Your email address will not be published.