You should write unit tests every day, unless you are too busy; then, you should write them twice as often

The title of this blog post is an adaptation of an old Zen saying:

You should sit in meditation for twenty minutes every day, unless you're too busy; then you should sit for an hour.

I like that there is wisdom that can be adapted to various aspects of life. An adaptation of the saying for unit testing: Because you haven't written tests, you're too busy fixing production problems to write tests. If you had a proper test suite, you could fine-tune existing features easily and confidently.

In my experience, this also applies to daily physical exercise. You don't have to spend many hours in the gym. I am talking about cycling to work, a daily walk in the forest, etc. Maybe you're too busy only because you are not in good enough physical and mental shape to perform daily tasks efficiently. Being out of shape leads to taking more time to finish tasks and needing otherwise unnecessary breaks. Therefore, you need to start exercising twice as often to have time for a daily exercise routine.

Can this wisdom be applied to freelancing or aspects of programming other than unit testing? I am sure it can be. I would love to hear your thoughts on this.

Discussion on Hacker News