The Big Lie About Clean Code and Unit Testing

Table of Contents

Introduction

Many people are convinced that waking up early, say at 5:00 AM, is an unrealistic fantasy for them. They believe that their nature and their body are constructed in such a way that it’s impossible. I used to belong to this group of people.

Finding a Reason

When you find a reason that makes waking up at this time meaningful (for example, you wake up early to write a few pages of your book, which you want to publish) or if you simply have to (because you have a newborn waking you up at this time), it turns out to be possible.

The Mechanisms of Habit

Let me tell you how it works. Let’s assume you have been studying leisurely for a few years, where waking up early was not a priority. Or perhaps earlier at home, no one specifically rushed you to get up early. Therefore, waking up later (7, 8, maybe even 9 AM) was normal. Your body and mind have developed many habitual mechanisms that support this way of functioning (metabolism, sleep depth, etc.). This becomes “your way of functioning,” and some people start to believe that “this is just how it is” or that “this is just who they are.”

Breaking the Habit

Of course, any change in the short term causes pain. If you start waking up two hours earlier than usual, it will be painful. Therefore, you need strong motivation—why do it, why subject yourself to discomfort, leaving the cozy comfort zone. Otherwise, the habit will quickly prevail.

The Lie About Clean Code and Unit Testing

If you’ve convinced yourself that you need to eat breakfast before leaving and you do it every day, you will genuinely feel sick if you don’t. If you’ve convinced yourself that you don’t feel hungry in the morning (because, at least for a period in your life, you overate in the evening, and then you don’t feel like eating in the morning), whatever you try to eat early in the morning will make you nauseous.

The same applies to the commonly expressed myth that there is no time to write clean, readable code and perform unit testing (or TDD, BDD). This is a lie in which most people believe because they have developed such habits—they never wrote that way, or they tried it for a few hours and failed. So why should they think differently? In their mental space, there is no place for what is not habitual. It’s time to wake up. It may hurt, but it can equally be an amazing adventure on the way to becoming a P R O F E S S I O N A L. The choice is yours.

(Text translated and moved from original old blog automatically by AI. May contain inaccuracies.)

Related Posts

A Few Words About Naming – Methods (In Progress)

Note: This article is a work in progress!

Maybe the topic seems trivial and worn-out, as everyone knows that you need to create clear, unambiguous names. However, it’s still a greatly neglected area. Teams are still far from understanding that the most depends on naming. No refactoring has as much power as changing a name. It is primarily the names, if used correctly, that form what is called self-documenting code, creating a clear language in the source code of the system you are building.

Read More

Conferences Time

Autumn is usually a busy time full of conferences, and this year is no different. After a few interesting events like Devoxx Poland in Cracow, Codepot and Agile by Example in Warsaw, it’s now time for new experiences.

Read More

Natural Course of Refactoring online on InfoQ

I am so delighted that the article about Natural Course of Refactoring is live. It is a very simple, yet powerful idea about refactoring (but not easy after all) and I hope this way it will reach more people than ever before. So please retweet it and share it wherever you can.

Read More