Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Using Private and Final In Open Source Software

DZone's Guide to

Using Private and Final In Open Source Software

· DevOps Zone
Free Resource

Download the blueprint that can take a company of any maturity level all the way up to enterprise-scale continuous delivery using a combination of Automic Release Automation, Automic’s 20+ years of business automation experience, and the proven tools and practices the company is already leveraging.

In recent months I've seen an increase in the use of private and final keywords used in open source software projects. While I'm not opposed to the use of these in writing software, I've noticed a disturbing trend in the reasoning to use them.

Since I started using and contributing to open source software, more years ago than I care to admit to myself, I've noticed one amazing thing. Software is used to build useful things the original authors didn't envision in ways the authors didn't foresee. This is an important concept to remember.

The only way one can know or imagine all the ways a piece of open source software could be used is to peek into the future and know what's happening in the minds of everyone. Can you do that? No... me either.

With that in mind, the use of private and final in software limits the ways software can be used. This is can be useful. If there is a design decision for a good clearly articulated reason not to allow a class to be extended than this makes sense.

If, on the other hand, there isn't a clear reason to make the design decision to use private andfinal than don't use them. By not using them you leave the possibility open for others to do things you couldn't imagine but they could.

This is about enabling others to be successful using what you've open sourced.

Download the ‘Practical Blueprint to Continuous Delivery’ to learn how Automic Release Automation can help you begin or continue your company’s digital transformation.

Topics:

Published at DZone with permission of Matt Farina, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}