Code Quality Levels

After working with software development for over 3 years, I have strong sense of responsibility to write good code. But how do we define code quality?

Well, if you Google this question, you can get tons of answers or opinions on this topic or question. Here I would like to share my thought.

There are basically four levels of code quality:

Basic: Yes. Everybody knows it. “It works“. The code you write should function and do what we want. This is something everyone understands no matter junior or senior programmers or non-tech people.

Good: The code should be easy to read. I am big fan of code readabillity. Everyone working with software development knows most of our time is actually spent on reading code. In my opion, the best love to our co-developers is writing readable code and make others’ life easier. We don’t want our colleagues to look at our code and swear. So just spend a little more time on refactoring your code before you push it. This is the first step of becoming a good programmer.

Great: The code is maintainable. That means when we want to make some changes to current code base, it should be easy to extend or modify. That requires our code to be well structured. Nowdays we have many tools or frameworks to help us achieve this much easier, such as MVC pattern andDepency Injection. What we really need to do is thinking lite more about the possible change in the future before rushing to write code.

If you can achieve first three levels, you would be loved by most of people working with you. But here are more things you can do to make you shine like a star.
– Unit Testing. You don’t need to write Unit Testing for every function or class. But it is good way to check whether your code. As people say “If cod is not Unit-testable, you may need to refactory your code”. I strong agree on this point.
– Peformance Improvment: Write code that not only runs but runs fast. Keep a good habit to think about better solution to improve performance.
– Task automation: If some taks are needed to do manually again and again, build or find a tool to automate it. We are developers. We can and should make it more efficient.