Recently, I had a chat with a few recent graduates about the standards for an excellent programmer, and I shared a few spontaneous thoughts. Upon reflection, I realized that this issue is quite universal and worth documenting to share with others.
In general, I believe that excellent programmers differ significantly from ordinary programmers in four key areas: they have the habit of writing unit tests, their code is highly readable, they possess high-quality refactoring skills, and they have strong abstract thinking abilities.
1. Unit Testing
The basic requirement for a programmer is to complete the development work and make sure the code runs correctly. When we run the code once and it produces the expected output, only half the job is done.
This is because there are still various inputs that may produce incorrect or unexpected outputs. The purpose of unit testing is to ensure that the program code behaves as expected in a variety of input situations.
In other words, unit testing is the most important method for moving from a program that is occasionally correct to one that is likely correct. It is the most basic requirement of an excellent programmer.
Unit testing is a typical example of white-box testing. For the Java tech stack, the primary testing tool is JUnit, which provides a framework for writing test code. The main metric for evaluating the completeness of unit testing is code coverage, which can be broken down into line coverage, branch coverage, method coverage, and so on.
There are mature tools for tracking coverage statistics, such as JaCoCo, which can be configured in Maven. High coverage is generally required, especially for important modules, where “line coverage” should be above 90% or even 95%.
2. High Code Readability
Many programmers have a misconception: they think that the easier their code is to understand, the easier it will be for them to be replaced. This viewpoint seems logical but actually hinders personal growth. A key aspect of software engineering is that it requires large-scale team collaboration.
This collaboration involves covering for one another. Extreme programming (XP) emphasizes the concept of collective code ownership, meaning that the entire team collectively owns and maintains the codebase. Any team member can modify any part of the code, improve the codebase, and enhance software quality.
Additionally, just like any critical system, software engineering shouldn’t have single points of failure. If only the developer can understand and maintain a piece of code, the system becomes incredibly fragile. Code that lacks readability may be understandable to the developer at the time but becomes incomprehensible even to them after six months.
If someone uses poor code readability to secure their job, they are unlikely to be assigned important development tasks.
3. Refactoring Skills
Refactoring is a vital tool for maintaining the longevity of software. Once a program is created, it doesn’t remain static—bug fixes and new features will disrupt the original design. The safest approach in these cases is to write incremental code by adding patches, avoiding changes to the core logic.
However, after some time, this approach can destroy the structure of the code, and the program’s readability and maintainability will rapidly decline due to the accumulation of messy branches.
Refactoring, on the other hand, considers new requirements holistically and, while ensuring the correctness of the results, maintains or even improves the structure of the code. Being able to perform high-quality refactoring is the litmus test of an excellent programmer.
Refactoring requires not just courage but also methodical approaches. Many programmers avoid refactoring due to its high risk—after all, the existing code has been validated in a production environment and is proven to be stable. Therefore, full-scale iterative testing is needed as a verification method for refactoring. To make this cost-effective, this full-scale iteration must be automated.
An excellent programmer should consciously accumulate test case scripts during development to run comprehensive functional tests automatically. If you're developing backend application services, you should gather data such as request messages, response messages, and context. If you have a well-established DevOps process, that provides organizational-level support for high-quality refactoring.
4. Abstract Thinking Ability
In programming, we encounter many specific problems that may seem different and require new solutions from scratch. However, excellent programmers are skilled at abstracting problems. They can extract the essence of the issue from a specific business scenario, much like the process of mathematical modeling. Once abstracted, it’s easier to find classic approaches to solving the problem.
As the saying goes, "There’s nothing new under the sun." Almost all the problems we face have established solutions. Without the ability to think abstractly, people tend to reinvent the wheel, thinking they’ve come up with something novel. But often, they’re just repeating old ideas, and sometimes, that wheel might even be square.
In my view, there are two ways to develop abstract thinking skills. The first is to read the design plans and code of foundational software. Since foundational software is detached from specific business contexts, its technical solutions are more general and are often compatible with business scenarios. In other words, the problem-solving methods in application software are often built upon the solutions in foundational software, with business constraints added on top.
The second method is to read top conference papers in the relevant fields and accumulate solutions to abstract problems. It’s like how martial arts masters train their inner strength—once the inner strength is strong enough, even the smallest actions can have a significant impact. This process moves from abstraction to specific implementation. It might be a bit painful at first, but starting with industrial papers can lower the difficulty. In this sense, abstract thinking serves as a critical bridge between solving real-world industrial problems and leveraging academic research.
Conclusion
In summary, the four key skills are the habit of writing unit tests, high code readability, high-quality refactoring ability, and strong abstract thinking. These four skills reflect a programmer’s self-discipline. Behind unit testing lies a reliable work ethic and professional spirit; behind code readability lies a collaborative mindset and openness; behind refactoring skills lies the pursuit of excellence and the courage to iterate; behind abstract thinking lies a solid theoretical foundation and a broad technical vision.