Code Quality in Reality

I’ve been a software developer, doing coding for about 9 years now, a few years ago I’ve always dream about having excellent, perfect the code quality that readable, maintainable, no stupid bugs, etc… yet here I am, at this point, experiencing the same thing over years, over time, then I think I get to the conclusion I want to share with you.

I complain about bad coding everytimes, I swearing and like “Who the fuck is wrote this code ?”. I’ve been always felt the former developer is the one to blame for the bad code. Oh god, I was so guilty.

Let’s be positive about anything. I can not blame the former developer for the bad code event tho the git history was created by him/her. As human beings, we all have problems. We can think that the former developer had been in hard times when he wrote the code. Maybe the deadline is too tight, at the time. Maybe he has a health issue, family issue and bad manager, Maybe the manager has bad manager, etc. Anyway, I will not blame anyone again for bad legacy code or anything, because I was one of the former developer myself.

Who is responsible for code quality ? I think everybody is responsible for writing good quality code. How about tech leads? managers? they can be partners to do code review, but still, good quality code is everyone’s responsibility. Code is like a public toilet, we have to keep clean and tidy for next customer. Keeping public toilet cleans is everyone’s responsiblity, yet we still need a manager to watch and reminds everybody, so is the good quality code.

We have to embrace that writing good quality code is slow, Yes, so what. When estimating a project, you have to consider having time to do refactor as well. You need tests to do the refactor, then consider having the time slot for that as well.

Code Quality vs Weeks to Deadline

We have to embrace that, Not everybody can go to a FAANG company and have a mature automated code-review, surrounded by 10x world-class engineers. No matter how good the plan is, problems coming.

In reality, there are times that you have to git-push anything to fix the production problem without care about the code quality or breaking tests. It is perfectly OK, your super high-quality code does not mean anything for the rest of your working partner, the sales, the operations, if the business is not running. You can schedule to refactor, and must, anytime later.

We are all just human beings at the end of the day. Code is just code. Software engineering is just a job. What is more important is what we build can bring something better to our neighborhood, we can bring food to our table, feed our family, and live a better life.