Clean as you code (replace "code" with anything you do)

Do you always feel so busy that you don't have the time to tidy your desk? Do you wish your living room would stay so neat that you could have friends over any time? The good news is that I might have found you an answer: Clean as you code (replace "code" with anything you do).

Here's my recent experience around that kind of problem. It's a tech metaphor for the versatile solution. As professional software engineers, we are responsible for keeping our code base maintainable and robust. Therefore, we use automatic code-quality checking tools. Some tools list all of the lines of code that do not meet the standard. However, when different developers change the source code, the warnings with descriptions the tools produce are from unfamiliar parts of the code to each developer.

On top of that, there may be existing warnings that everyone has been ignoring. It is unclear if you are responsible for correcting all the lines to eliminate the warnings. If you decide to do it, it will take too long to get to the task with a deadline. This is when the "clean as you code" concept is handy. In this concept, you are only responsible for the quality of your new code. We use SonarQube to analyze new code, but don't worry about the technical details if you are not a developer.

This concept has been surprisingly applicable to many of my daily routines. My problem was that I either spent too much time decluttering my entire home office before I started working on a task, or I opted to do no clearing because I felt that I didn't have time. After I tried to use the clean-as-you-code approach for a while, my desk and living room gradually increased their neatness levels. Every time you clean around your small task, you improve the cleanliness of the entire system. Over time, the overall cleanliness improves. The code you just wrote is fresh in your memory, so it is easy to clean. The table you just used for lunch is right before you; you don't have to move.

Try this concept in your daily routines, and let me know the results! This concept is pretty simple, but more complex computer science concepts can also be applied to our daily lives. This book, Algorithms to Live By: The Computer Science of Human Decisions, includes concrete examples. I plan to write about them in the future. If you haven't subscribed to this blog, find and click on Subscribe by email.