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

Automatic continuous monitoring keeps continuous deployment pipelines flowing smoothly and efficiently. Try Instana APM to automatically monitor containers and microservices!

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.

Automatic real-time observability is critical to getting the full benefit of CI/CD. Hear @DevOpsDon discuss how Franklin American Mortgage Company cut their new application deployment time from 6-12 months to 2 weeks with the help of Instana APM.

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}