PEP 318: Can't we all just get along?
Colin J. Williams
cjw at sympatico.ca
Thu Aug 19 13:58:35 EDT 2004
Roy Smith wrote:
> Anthony Baxter wrote:
>
>>>Look, name-mangling is horrid, and I don't think anyone's defending it. But
>>>at the same time, "name mangling is there" is not an argument for extending
>>>the horror to a whole new level.
>
>
> Paul Morrow <pm_mon at yahoo.com> wrote:
>
>>I disagree. It's an effective name-hiding technique. Simple +
>>Effective = Good.
>
>
> I disagree with your disagreement :-)
>
> I find a mix of text and puctuation difficult to read. Human brains
> don't read letters, they read whole words. That's why, for example,
> it's so easy to make a typo and not notice it. I find "word.word" easy
> to parse, but "word.__word" much more difficult.
I agree, but see this as similar to the naming convention:
long_symbolic_representation at first glance,
this looks like
three names
why not:
longSymbolicRepresentation? this makes the oneness
clearer
Returning to the subject line - When will the final decision be handed
down?
My own preferences are: (1) transform or transformer not decorator
(2) the transforms should follow the thing
being
transformed. i.e. after the script has
declared the name.
(3) a list of transforms.
(4) the list should have one entry per line,
to make reading easier.
Colin W.
I don't know if it's
> the switching back and forth between letters and symbols, or the
> juxtaposition of the two symbols down on the baseline (i.e. ".__") that
> makes it hard to read.
>
> This is true of the __name__ convention for internal names too, but
> somehow I don't find that as bad. Maybe because it's symmetric? Maybe
> because my brain recognizes the whole __name__ as a unit, with the
> "name" part of it being what I really recognize?
>
> Even worse is when mix them. Stuff like "__myPrivateFunc.__name__" is
> total gibberish to me.
>
> Oh my god, I just realized (Ob decorator comment here) that if we start
> having people write private decorators, we'll have things like:
>
> @__decorator
>
> which really makes me barf.
More information about the Python-list
mailing list