Andre Poenitz <[EMAIL PROTECTED]> writes:

| If you desperately need to protect against abuse of your classes, you need
| "private". On the other hand, the most likely "abuser" are yourself, so
| you pay (writing accessor functions, compile times, probably run time) for
| something you might not _really_ need.

with accessors you can eaily change from a cached value to a generated
one... this is impossible if you alway access the variable directly.
 
| I usually consider "protected" member vars good enough for most practical
| reasons, especially if they are used only within the class's hierararchy
| (i.e. don't have public accessors).
| 
| I don't really like constructs like
| 
|   count( count() + 1);
| 
| and _much_ prefer  
| 
|   ++count_;

then I am going to claim that the responsibility for the count
variables is wrongly placed, and _that_ is why you end up with the
ugly code.
 
-- 
        Lgb

Reply via email to