Re: final protected private symbol

"Stephen R. van den Berg" <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Message-ID <[email protected]>
Martin B??hr wrote:
>Excerpts from Stephen R. van den Berg's message of 2014-11-12 03:24:01 +0100:
>also, in your mail archives:
>http://osdir.com/ml/lang.pike.user/2008-07/msg00004.html :-)))

Well, I get an A for consistency.  It appears that nobody answered my
questions adequately back then, and 6 years later, it's still that same
nagging feeling that I do not know enough :-).  I already forgot I asked
it back then.

Rereading all the docs I now conclude the following
(anyone more knowledgeable, please speak up):

- If a member is not part of the public interface, make it private by default.
- A member that is private is already protected, local and final by
  implication.
- Use protected instead of private expressly only then when subclasses
  are supposed to access this member.
- Use final on all public and protected members unless they are expected
  to be overridden by subclasses.

The above guidelines would result in the most efficient and compact code.

The use of local is an odd one; it's probably something that is rarely
used if ever.  Does anyone have a typical example that makes sense?
-- 
Stephen.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.