Does Python really follow its philosophy of "Readability counts"?

Mark Wooding mdw at distorted.org.uk
Fri Jan 23 15:09:48 EST 2009


Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> writes:

> On Fri, 23 Jan 2009 13:57:52 +0100, Bruno Desthuilliers wrote:
>> Why on earth couldn't I change the code of another member of my team if
>> that code needs changes ? The code is the whole team's ownership.
>
> That's a model that works well when you have a small team of, say, a 
> dozen people. It's not a model that works when you have hundreds of 
> developers working on the project. The last thing I want in my projects 
> is cowboys who ride all over other people's code, changing internals of 
> parts they barely know at the drop of a hat, causing who knows what side-
> effects.

Why are you assuming that Bruno would make his change in such an
irresponsible manner?  Such things need discussing, with some
appropriate level of formality, with the people most involved with the
relevant code -- which might be anything between a quick chat with the
bloke across the room or an agenda item on the next team meeting to a
written proposal.

Given your apparent readiness to assume the worst of programmers at
every opportunity (e.g., your above assumption that Bruno would change
code unilaterally and secretly, assumptions elsewhere that programmers
treat any exposed wiring as being published interface), I can only
assume that you really need to get some better cow-orkers.

> But anyway, this is a red-herring. Data hiding isn't really about 
> managing the development process, it's about ensuring that when you and 
> Fred are using Barney's OrderedDict class in your code, Barney is free to 
> change his the implementation without your code suddenly failing. It's 
> also to ensure that any changes you make at runtime to the class don't 
> suddenly make Fred's code break.

If Barney, Fred and I share a room, we can discuss what we need from
OrderedDict around the water-cooler.  If we're all in different
continents, the tradeoffs look different.

If Barney's the kind of guy with quick turnaround, I might well just ask
for the necessary change.  If I'll have to wait for the next release in
July (for posterity: it's January now) I'll probably hack the guts now.
If I do that, Barney's still free to change his implementation.  It
might screw me, but that's my problem and not his; the alternative, with
mandatory `hiding', is that I just lose: possible breakage down the line
looks like an improvement.

Now we come on to Fred.  If Fred's across the room from me then we're
back to the water-cooler.  If he's on a different continent, and I know
he'll be affected, I'll probably email him.  If I've never heard of him
at all, well, he might just lose when someone puts my code and Fred's
together with OrderedDict; hopefully I'll get a bug report (I ought to
have put a notice in with my distribution explaining that it uses
undocumented internals of OrderedDict, so I should be in the firing
line) and we'll sort through the wreckage.  But again, if I just lost in
the second paragraph, we wouldn't even have got this far.

-- [mdw]



More information about the Python-list mailing list