|
![](/i/fill.gif) |
Warp wrote:
> For example, in C++ a base class can have a private member with a certain
> name, and a class derived from that base class can have a private member
> with the same name. There's no clash.
That's cool. I imagine that helps with maintaining large code bases that
other people are inheriting from.
> Also, what naming convention is used in Python for a protected member
> variable or function?
I'm not sure, honestly.
> Private inheritance is not an extremely common technique in C++, but it
> sometimes has its uses (one could think of private inheritance as a kind
> of composition where the object itself can act as an object of either the
> base or derived class). I suppose there's no such a thing as private
> inheritance in Python.
Given there's no "private", no, I don't think you'd have "private
inheritance." :-)
> There's this thing called reading comprehension. Understanding what the
> other wrote, in its context, rather than nitpicking on words.
Yeah, let's both try to improve that. :-)
>> Yes, there are. There's even one I pointed out to which you said "Well, duh,
>> that's the definition." Remember?
>
> The size of an object says nothing about its layout.
It does. And I've given you multiple examples where it does. The very fact
that "sizeof" is defined tells you something about how you have to implement
things.
> Actually there's no such guarantee. If you use virtual inheritance in a
> diamond inheritance situation, the common base will be shared among the
> classes which were multiple-inherited from. This means that the layout
> of the objects inside the most derived class will be split, rather than
> being at contiguous memory locations.
Really? OK.
> Depends on the debugger. For example programs like valgrind and AQtime
> are quite good at catching out-of-bounds accesses, memory leaks and such.
Yeah. Now, get them to run while the graphics chips are expecting you to
respond promptly to interrupts, and without taking up more than another 3K
of memory. :-)
> (Of course they can't catch every possible bug, but quite many.)
True. Of course, I'd argue that the existence of such tools show that such
bugs are not so uncommon that they're worth disregarding. :-)
--
Darren New, San Diego CA, USA (PST)
The question in today's corporate environment is not
so much "what color is your parachute?" as it is
"what color is your nose?"
Post a reply to this message
|
![](/i/fill.gif) |