Virtual functions are virtually invisible!

rantingrick rantingrick at gmail.com
Mon Jul 11 09:42:50 EDT 2011


On Jul 10, 11:45 pm, Michael Hrivnak <mhriv... at hrivnak.org> wrote:
> I can't believe you're saying that you will create a sub-class without
> taking the time to understand the base class.

I'm NOT saying that so stop putting words in my mouth!

> Seriously?  That right
> there is why you are seeing method overrides that aren't documented.

You being a bit bombastic now with this *rolls-eyes*

> How can you document something you don't understand?  Furthermore, how
> can you have any confidence in your subclass if you don't understand
> what its base class is doing?  Do you write unit tests?  How do you
> know what to test if you don't understand the code you are
> subclassing?

You took my simple statement of... " It is not ALWAYS necessary to
have an intimate knowledge of the base class when creating derived
classes"... and extrapolated THAT nonsense?

Okay let me show you a simple example of not needing to know the base
class intimatly. I'll use the tkSimpleDialog...

class MyDialog(tkSimpleDialog.Dialog):
    def body(self, master):
        #imagine i created widgets here.

NOW. Would it really be nessesary at this point to have an intimate
knowledge of the base class? Hmm?

> Suggesting that no developers document their methods?  Incredible.

Very, very few document clobbered virtual methods. yes.

> Clobbered methods have "magic"?  Multi-layered "magic"?

Of course! That is, in the perverted case of Clarke's third law[1]...
"Any sufficiently advanced technology is indistinguishable from
magic"... And since class inheritance can be multi-layered, um, you
get the idea.

>  Perhaps when
> you take the time to 1) document the base class and 2) understand that
> base class before subclassing it, that "magic" will start to look like
> reasonable and logical processes.

You're preaching to the choir reverend!

> Professional developers document their code.  They take the time to
> understand the code they are working on.  If you don't want to do
> those things, that's your business, and I'm sure you can find other
> people who also don't do those things.  But I really don't think
> you'll have much success changing the language to accommodate your
> refusal to follow the most basic best practices.

It's not me that needs to change kind sir, it is the community in
general. I document my code. I follow the python style guide. I always
create unit tests. Unfortunately no matter how well i write code i
cannot force others to do so. Heck i have posted many fixes for the
abomination called tkSimpleDialog and not only do they refuse to
upgrade the code, they refuse to even post comments!

This mandate must be handed down from the gods who reside on "Mount
REFUSE-E-OUS to RECOGNIZE-E-OUS a major PROBLEM-O-MOUS"

[1] http://en.wikipedia.org/wiki/Clarke's_three_laws



More information about the Python-list mailing list