Questionable use of protected in java
I see this a lot in java source code -- the use of protected instead of nothing (which means package-private). What I'm talking about are cases where there are not only no classes in other packages that extend the classes with protected members. But, there are obviously no plans for that to ever happen in the future either. That's the only use of protected over nothing -- it allows you to access protected stuff from a subclass in a different package.
It's easy to keep the visibility level of these methods and variables more protected than protected -- do nothing. Which I'm pretty good at...
protected is less protected than nothing.
Posted by topher on May 10, 2006 at 07:40 AM PDT #
Posted by Lloyd Chambers on May 11, 2006 at 12:39 PM PDT #
Few people understand that 'less people' is nonsensical--have the people been chopped into bits and bagged? Good thing Java doesn't use 'few' and 'less' as keywords. 'Fewer' should be used for things that can be counted (fewer than four players), while less should be used with mass terms for things of measurable extent (less paper; less than a gallon of paint).
Posted by Lloyd Chambers on May 11, 2006 at 12:46 PM PDT #
Posted by dfgdf on October 14, 2006 at 06:35 PM PDT #
Posted by dfg on October 14, 2006 at 06:35 PM PDT #
The problem I see is that nobody seems to know what protected actually means and less people know that nothing exists.
Posted by Warhammer Online Gold on March 11, 2009 at 10:33 PM PDT #