List Info

Thread: Re: Obtain reference to component




Re: Obtain reference to component
country flaguser name
United States
2007-10-24 08:20:17

Hi!

Many hardcore OOP programmers (C++ included) only use member variable
names for class internals when they need to be "visible" outside the
class. They also prefer using Get/Set/etc. functions for obtaining
information internal to the class, not public variable names. In my
mind, it's a bit fanatical. I greatly prefer (and use) the method you
suggested.

Rather than routinely making everything "private" (as is the OOP
convention), only violating this and making "public" or "protected"
when absolutely necessary, I generally do the opposite. That is, make
it private/protected only when necessary. I guess "necessary" is the
operative word here. It's rather subjective. OOP programming uses
a "better safe than sorry"; philosophy. My question to this is "safe
from what?"; and at what expense?

There's an old quote in the UNIX world in reference to OOP
programming and its epitomical language, Lisp. It goes:

Lisp programmers know the value of everything and the cost of nothing.

A rather sharp indictment, but it does have a fundamental point.
Data/function hiding is expensive, processing wise. So the question
is, is this hiding such a holy grail? To many, it is!;)

thx,
Dave S.

--- In anthemion-devtools%40yahoogroups.com">anthemion-devtoolsyahoogroups.com, Matthias Buelow <mb...>
wrote:
>
&gt; ddotedotsdot wrote:
&gt;
> > However, in deference to folks who like such things "hidden", you
can
> > alternatively use one of the wxWindow::FindWindow
> > [ById|ByLabel|ByName] functions (since most all "visible"
wxWidgets
> > elements are derived from wxWindow). Personally, I find it an
> > unnecessary level of indirection and cumbersome to use, but many
> > prefer it as a "general/conventional"; C++ paradigm.
>
> In what way would that be a "general/conventional C++ paradigm&quot;?
>;
>
> --
> Matthias Bülow Schaeffer AG
> Hohentwielsteig 6a Tel. +49-30-8058695-0
> 14163 Berlin Fax: +49-30-8058695-33
> http://www.schaeffer-ag.de
&gt;
> HRB 93611 B, Amtsgericht Berlin Charlottenburg
> Vorstand: Jörg Schaeffer, Kai Schaeffer
> Aufsichtsrat: Dieter Kersten (Vorsitzender)
>

__._,_.___
.

__,_._,___
Re: Re: Obtain reference to component
country flaguser name
Germany
2007-10-24 09:03:34

ddotedotsdot wrote:

> Many hardcore OOP programmers (C++ included) only use member variable
> names for class internals when they need to be "visible" outside the
> class. They also prefer using Get/Set/etc. functions for obtaining
> information internal to the class, not public variable names. In my
> mind, it's a bit fanatical. I greatly prefer (and use) the method you
> suggested.

Ok, I was under the impression that damian wanted to access the control
from within the class scope; and he just didn't have a "handle" (name)
for it. Filling in the above mentioned field lets DialogBlocks create a
member in the dialog class instead of only using a temporary variable in
the CreateControls() function where the respective children control
(widget) is created.

> operative word here. It's rather subjective. OOP programming uses
> a "better safe than sorry"; philosophy. My question to this is "safe
> from what?"; and at what expense?

Not all OO systems use data hiding; these are two orthogonal concepts.
And I agree that it's often more of a problem than it helps prevent
(same with strict compile-time typing).

> Lisp programmers know the value of everything and the cost of nothing.

Modern Lisp systems come with a profiler.

--
Matthias Bülow Schaeffer AG
Hohentwielsteig 6a Tel. +49-30-8058695-0
14163 Berlin Fax: +49-30-8058695-33
http://www.schaeffer-ag.de

HRB 93611 B, Amtsgericht Berlin Charlottenburg
Vorstand: Jörg Schaeffer, Kai Schaeffer
Aufsichtsrat: Dieter Kersten (Vorsitzender)

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )