Step on my soapbox... :-)
I believe that the "final" keyword is underused in Java. I have
gotten into the habit of using it on EVERY method parameter, instance
variable, and local variable unless I have reason not to do so. I
also use it on class definitions although one could argue that that
defeats the idea behind code reuse (I have the source code and can
change it to not be final if necessary).
I also believe that package-private is WAY underused. All of my
methods are declared without "public" unless they must be visible
outside of the package.
What do others think?
I believe that the "final" keyword is underused in Java. I have
gotten into the habit of using it on EVERY method parameter, instance
variable, and local variable unless I have reason not to do so. I
also use it on class definitions although one could argue that that
defeats the idea behind code reuse (I have the source code and can
change it to not be final if necessary).
I also believe that package-private is WAY underused. All of my
methods are declared without "public" unless they must be visible
outside of the package.
What do others think?
Comment