| 
  | 
Darren New <dne### [at] san rr com> wrote:
> Warp wrote:
> > 1) I write "private:" once in my class definition.
> > 
> > 2) I write extensive documentation about the subject and hope people will
> >    read it and obey it. Many people won't.
> You missed this one:
>    3) You name your private variables with the naming convention used by
>       every other package ever implemented in that language, including
>       the ones that define the runtime, and which every programmer knows
>       bypassing means future incompatibility.
  I still prefer option #1. It's not like it would exclude option #3, so
you get the best of both worlds: Clarity in naming conventions, *and* the
compiler checking the integrity of the interface.
> >   And what's wrong with the compiler telling you if you try to use it
> > regardless? I really can't understand that.
> You already know you're using a private variable, if you're bypassing either 
> global naming conventions or using reflection or something.
> If the compiler actually *prevents* it, then you're locking yourself out of 
> a whole bunch of metaprogramming techniques that templates aren't adequate 
> to handle.
  And if you don't prevent it, you are locking yourself out of ever trying
to improve your module (without breaking tons of existing code).
-- 
                                                          - Warp
 
 Post a reply to this message 
 | 
  |