Open Source Projects Could be also Considered as Code Quality Tutorials
Quality is not something that can be easily added later. It’s preferable to take care of it from the beginning. Many companies dedicated a big budget to purchase tools with many thousands of dollars and called upon independent consultants to audit their code base and produce some reports. This is still a good initiative to improve the code quality.
However, after few years of the analysis of many open source projects developed with C/C++, Objective C and java we can confirm that most of them are well designed and implemented despite the fact that the open source contributors do not have resources like companies. Most of them work only at night or on holidays and they produce a very good code.
I am not talking here only about the open source projects sponsored by companies like Google or Facebook, where the most of the contributors are employees in these companies. But also about projects developed by independent developers who use their own resources to provide us many useful libraries and applications.
Many times after the analysis of an open source project, we discover many interesting best practices, and we decide to refactor some pieces of our code to improve it as implemented in these projects. These best practices could not be detected by any tool or identified by any quality metrics, they need to be identified by developers who care about the quality of their code.
What’s the secret of the open source contributors?
To understand why the open source code is generally well implemented, we have to know the contributor’s motivations. Their goal is not to be rich, maybe some of them could look for the glory. But most of them they love what they do and code with passion, what makes a big difference.
Developing a solution because you have to, you are paid for; it’s not the same thing if you develop it because you enjoy producing a good application.
For companies not having a dedicated budget for quality, a good solution could be encouraging developers to spend few hours/week to explore some open source projects and discover some best practices to apply them later in their code.
And even if you purchase the most powerful quality tool, you need to employ developers who love what they do. But the big problem is how to identify them?
Here are some interesting open source projects to explore:
- Apache Commons
If you try to improve the quality of your code base by:
- Reading books and tutorials.
- Reading resources from the web sites.
- Doing a training.
- Using tools.
Try to explore some open source projects to discover how they are designed and implemented, maybe the result will be more surprising than you expect.
This post was originally published in: https://cppdepend.com/blog/?p=1075