Failure is an Option

Failure is often a dreaded word. It need not be. Programming is an art where it’s very easy to fail and you can usually fail fast. Use it to your advantage. Learn to fail with style.

Give yourself the option to failĀ deliberately and safely. Many tools can help you:

  • Branches – Since I started using git, I often create a branch to play around with the code… then delete it and start again from scratch once I know where I need to go. This gives me the freedom to change configurations, disable features and modify code without tests. I even go as far as breaking existing features (sometimes they don’t even compile) if it makes me learn faster.
  • Prototypes – create a simple throw-away project to test your code.
  • Tracer bullets – whenever I need to connect a few modules together, I like to have a tracer bullet that will handle the normal path without any error handling. It gives me confidence that all the pieces fit together. It proves the chosen architecture works and yields the expected results.
  • Tests – if I want to know how a particular method/class reacts in a specific context, I will sometimes create a test to test my behavior. I might keep the test as-is or sometimes I throw it away and it becomes part of a larger test.
  • Scripting languages – ruby, python, groovy or whatever you fancy, these languages can often help you test an algorithm faster than in Java or C#.
  • Pen & Paper – low tech, but sometimes writing down your thoughts is the best way to go. If it doesn’t work on paper, chances it works on a computer is pretty slim.
  • Rubber duck – having an inanimate yellow friend near your computerĀ that you can always talk to can never hurt :) .

A rubber duck

Code is cheap and fast to write… once you know the way. A few failures early on will help you get a success when it counts.

One Response to “Failure is an Option”

  1. [...] Rubberducking Thoughts about programming, technology and agility « Failure is an Option [...]

Leave a Reply