Sharing is easy. Everyday we have faster, easier and many more ways to do it. Sharing is also important. They say happiness gets bigger when it’s shared, as sorrow gets smaller. We share everyday and we feel good about it. We share our knowledge about an issue, we share advice when needed, and we share our opinion on all sorts of things.
But the best thing about sharing is when our friends also share their points of view, giving everyone a better vision of the topic and enriching each another through a new perspective.
Sharing code is similar.
Sharing code, on GitHub, for example, is critical to making changes, improvements, and updates to applications. Then, the code needs to be maintained. Making it visible to everyone ensures that changes can be made without too many difficulties.
Imagine that you find an open source application that perfectly fits your needs. You access the code, but you can't understand it because the creator didn't use a set of best practices. Or imagine that you find an application that is close to fitting your needs but you want to modify and improve it. You access the code, but it is cramped on a single 5,000 lines file. Or it has a high cyclomatic complexity and high rates of duplicated code.
What would you do? Maybe you would start writing code from scratch instead. So, how can we be sure of our code’s legibility, maintainability, and reusability? You guessed it: measuring and analyzing your code, and doing it continuously.
I work with a tool for measuring and analyzing code called Kiuwan—there are many others out there—and among the many characteristics of quality software, it focuses on and strongly emphasizes maintainability. The process is:
- upload code or download analyzer to local computer
- get results (risk and quality indicators, defects found, and the effort required to fix them)
Using a tool like this ensures that the sharing chain of code does not break. And, that is what open source is all about. Go forth and analyze your code!