Twitter GitHub Facebook Instagram dirv.me

Daniel Irvine on building software

Discipline

30 June 2014

Software craftsmanship puts heavy emphasis on discipline. It’s often hard to quantify exactly what discipline is, but we can think of it as the opposite of laziness. Software development is a skill, and just like other highly precise skill sets--martial arts, gymnastics and athletics, to name a few--it requires not just practice but disciplined practice, and not just disciplined practice but a lifetime of disciplined practice.

The reward for being disciplined is constant progression toward mastery. Each new technique we learn must be perfected by timeless practice. As we internalize these techniques with immaculate precision, we open space in our minds for newer and greater lessons.

If instead we are always sloppy and never perfect the easy lessons, how can we ever progress to the harder lessons?

Examples of software engineering discipline

Here are some specific ways you can be disciplined in your daily practice. How many of these do you strictly adhere to?

  1. Always commit early and often--perhaps after each time all tests are green.
  2. Never write vacuous commit messages. “Updated tests” or “new class” helps no one.
  3. Never check in code that you aren’t proud of--refactor until it’s the best it can be.
  4. Never write tests simply to maintain coverage. Your tests should equate to specifications, and that should be enough to maintain coverage.
  5. Always delete unused code. Don’t comment it out. If you need it again, it’ll be there in your source control system. (You have one of those, right?)
  6. Ensure your methods, types and variables are all named well. If you’re refactoring, don’t forget to rename when it makes sense.
  7. Minimize time spent surfing the Internet. Turn off Facebook, Twitter, and even your email when you’re getting work done.
  8. Always delete extraneous comments in your codebase and strive to never add in new comments!
  9. Never disrespect or disparage teammates--have the mental strength to see the value in everyone.
  10. Always listen to others carefully when debating issues.

That’s a good start but the list is endless--I’d be keen to hear other practices that you follow daily.

About the author

Daniel Irvine is a software craftsman at 8th Light, based in London. These days he prefers to code in Clojure and Ruby, despite having been a C++ and C# developer for the majority of his career.

For a longer bio please see danielirvine.com. To contact Daniel, send a tweet to @d_ir or use the comments section below.

Twitter GitHub Facebook Instagram dirv.me