Re: final protected private symbol
Chris Angelico <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <CAPTjJmoy0pk3J7yjd5KVnXesV0k-0UqHzfMFGe1m-tawntMd7Q@mail.gmail.com> |
On Wed, Nov 12, 2014 at 9:20 PM, Stephen R. van den Berg <[email protected]> wrote: > 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. - If you've fallen in love with Python's simplicity, ignore all these keywords and leave everything public. Has anyone benchmarked the various keywords and seen how much performance improvement you get? In theory, 'final' at least ought to result in faster code, but how much? ChrisA