Quality is not something that can be easily added later; it’s better to take care of it from the beginning. Many companies allocate large budgets to purchasing tools that cost thousands of dollars and hire independent consultants to audit their codebase and produce reports. This remains a worthwhile initiative for improving code quality.
However, after several years of analyzing many open source projects developed in C/C++, Objective-C and Java, we can confirm that most of them are well designed and implemented, even though open source contributors don’t have the same resources as companies. Many of them work only at night or during holidays, yet they produce very high-quality code.
I’m not referring only to open source projects sponsored by companies like Google or Facebook, where most contributors are employees of these companies, but also about projects developed by independent developers who use their own resources to provide the community with many useful libraries and applications.
Often, after analyzing an open source project, we discover valuable best practices and decide to refactor some pieces of our code to improve it by following the approaches used in these projects. These best practices can’t be detected by any tool or identified by any quality metric; they have to be identified by developers who care about the quality of their code.
What’s the secret of open source contributors?
To understand why open source code is generally well implemented, we have to know the contributors’ motivations. Their goal is not to get rich; maybe some of them are looking for glory. But most of them love what they do and code with passion—and that makes a big difference.
Developing a solution because you have to, because you’re paid for it, is not the same thing as developing it because you enjoy producing a good application.
For companies without a dedicated quality budget, a good approach could be to encourage developers to spend a few hours a week exploring open source projects and discovering best practices they can later apply to their own code.
And even if you purchase the most powerful quality tool, you still need to employ developers who love what they do. The big question is: how do you identify them?
Here are some interesting open source projects to explore:
C/C++
Java
If you’re trying to improve the quality of your code base by:
- Reading books and tutorials.
- Reading online resources.
- Taking training courses.
- Using tools.
try exploring some open source projects to discover how they are designed and implemented—the results might surprise you.
