POV-Ray : Newsgroups : povray.off-topic : This is the sort of brokenness... : Re: This is the sort of brokenness... Server Time
7 Sep 2024 07:21:03 EDT (-0400)
  Re: This is the sort of brokenness...  
From: Warp
Date: 20 Mar 2009 17:30:25
Message: <49c40af0@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Does that answer it? I probably gave way more details than you were actually 
> asking about. :-)

  I actually didn't understand your answer. There might have been some
miscommunication.

  Let me restate:

  There's a class named 'OuterClass', which has a public interface for
everything else to use, and a private part which is used only by 'OuterClass'
itself, and should be accessed by anything else.

  This private part declares another class named 'InnerClass'. This class
in question is part of the private implementation of 'OuterClass', and thus
should not be used in any way from the outside. However, 'OuterClass' itself
can, naturally, use it as usual.

  However, 'InnerClass' itself also has a public and a private part: The
public part defines the interface for 'OuterClass' to use. The private
part is for the internal implementation of 'InnerClass' itself, and shouldn't
be accessed by 'OuterClass'.

  The question is: If we are using a naming convention to denote public
and private data, how do you name 'InnerClass' and its private members?

  Since 'InnerClass' is part of the private implementation of 'OuterClass'
and thus should be used from the outside, I assume that the convention is
to call it '_InnerClass' (or whatever). The underscore denotes "don't
use this class from outside 'OuterClass', because it's private".

  How how do you name the members of this '_InnerClass'? All of its
members, even those in the public interface, are part of the private
implementation of 'OuterClass' and thus shouldn't be used from outside,
so do you put underscores in all the members, even public ones?

  What about the private members of '_InnerClass'? How do you differentiate
them from the private members of 'OuterClass'?

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.