|
 |
Warp wrote:
> Darren New <dne### [at] san rr com> wrote:
>> I don't know. C# does it by not having header files.
>
> Well, nothing stops you from implementing everything *in* the class
> declaration in C++. (Well, except if you want to keep some degree of
> modularity.)
Right.
>> I'm merely pointing out that it's hypocritical to claim that it's better to
>> *have* to maintain something manually because then you're not dependent on a
>> tool to maintain it.
>
> I don't see separate declarations and implementations as such a big problem
> as you seem to.
I don't either. I'm just pointing out that it's silly to say not *having* to
do that is a *problem.* I'm not bashing C++. I'm saying it's silly to say
that C++ is superior in the aspect that it *makes* you manually maintain a
separate file with the information in it that C# programs can generate
automatically. At least because you can *also* maintain that information
manually in C#.
> How do you stop someone from adding a new private function to your class
> from the outside, then?
Because you have to compile all the parts of the class at the same time in
C#. If you're *really* worried about it, you sign the result. :-)
>> That doesn't work for instance methods, does it? An instance method
>> actually has to be a member of the class in the class declaration, yes? (I'm
>> just double-checking I understand that part.)
>
> Well, if everything is public, what do you need private methods for?
Where did I say everything is public? I just said that the private methods
wind up being visible in the public "interface" file in C++. Again, I was
just commenting in terms of people complaining there was too much "visible"
in the C# way of doing things.
> You can replace them with
> local functions (ie. local to the compilation unit, ie. in a nameless
> namespace).
Hmm. But you don't get a "this" pointer, right? You need to start being
explicit about everything that OO is supposed to make implicit, like
accessing member variables from inside the function and all?
--
Darren New, San Diego CA, USA (PST)
I ordered stamps from Zazzle that read "Place Stamp Here".
Post a reply to this message
|
 |