The Four Noble Truths of Coding

The four noble truths in Buddhism are, approximately:

Life is suffering. The origin of suffering is attachment, due to ignorance. The cessation of suffering is attainable. The eight-fold path leads to liberation.

I was coding happily along, and realized in a flash of insight that this applied to what I was working on.

In coding, suffering comes from:

  • not being comfortable making a change because you don’t quite understand how the system works
  • working hard but realizing your code is still buggy
  • a client being less than impressed by “a change that couldn’t break anything”, but did
  • not being able to refactor because you can’t see all of the implications
  • wondering if this ever really worked at all
  • having that bug pop up again, although we thought it was fixed
  • not delivering with quality and on time

The Four Noble Truths of Coding

Coding is suffering. The origin of suffering is attachment, due to ignorance. The cessation of suffering is attainable. The path of executable specifications leads to liberation.

This is a bold statement to make. By using automated means of capturing the assumptions present in code, one breaks the painful cycle that comes from ignorance about the code base. Coding then becomes not suffering, nor not-not suffering, but just coding. Instead of coding in fear, it again becomes a creative process that encourages working with others in harmony. With automated tests of some sort, instead of having the law of cause and effect operating over the course of months, weeks, or days, feedback operates instead in terms of minutes.

However, there is a middle path to take here. If one is entirely safe, one loses the creative edge that makes the project exciting and lessens nimbleness with too much process and boilerplate. If one is too loose, one stands to let some quality slip. Experience seems to be the best guide.

This thought probably emerged from reading philosophy and Working Effectively With Legacy Code.

Categories: main

« A Tool for Your Toolbox: Fold Calendar What Does Everyone Know You For? »

Comments