Blog2: Programming Obsession (编程偏执)

中文版本

I believe everyone develops their own programming obsessions, as long as they've written enough code. Recently, I realized how much my obsessions have influenced me. This influence isn't necessarily negative. In this blog, I will explore the difference between obsessions and habits, and share my own obsessions.

Firstly, it's essential for us to understand the difference between an obsession and a habit. Here's a definition of each in programming:

Habits are routines we follow almost automatically, making our workflow smoother. Obsessions, however, are deeper and more intense. They reflect our personal quirks and fixations, such as an insistence on a specific coding style or a need to refactor code to perfection.

The term "obsession" doesn't exactly have the best connotation. In everyday life, we might encounter obsessive people who go crazy over seemingly minor things. For example, some might lose their cool if we don't use communal chopsticks or if we don't change into pajamas when entering the house. They can become quite hysterical about it.

When it comes to coding, it's pretty similar. A programmer might become fixated on a particular aspect of their work. For instance, they might spend an excessive amount of time making sure every variable name is perfectly descriptive or ensuring that their code is absolutely optimized to the last millisecond of performance. These obsessions can sometimes seem a bit over the top, and they might even slow down the overall progress of a project.

But here’s the thing – these coding obsessions can also have a silver lining. They often drive us to produce cleaner, more efficient, and more maintainable code. It’s like having a double-edged sword: it can cut both ways. On one hand, it can lead to unnecessary stress and time consumption; on the other hand, it can push us to achieve a higher standard of quality in our work

Now let me share my own programming obsession:

I have a particular fondness for refactoring code. When I’m diving into a new field, I usually start by finding the most popular code everyone’s using. But instead of tweaking it directly, I spend a lot of time rewriting it to fit my own coding style. The original code and my style are just too different for me to work with it as-is.
During this process, I get a better understanding of how different modules interact. However, this obsession comes with significant risks. It’s very easy for me to introduce errors while refactoring. The minor issues might just cause runtime errors, which I can fix. But the major issues are the silent bugs that don't throw errors but cause the model's performance to drop below the baseline or make subsequent improvements fail entirely. Despite these risks, I just can't bring myself to use the original code.
That’s my obsession. I can’t accept using the original code, and I spend a lot of time refactoring to make it my own, even if it means facing these potential pitfalls.

Everyone has their own obsessions because everyone is unique. I love my obsessions, and I hope you embrace yours too. Wishing you all a smooth and enjoyable coding!