Dependency Inversion Principle -- Python Way

Alex Martelli aleaxit at yahoo.com
Tue May 22 03:48:44 EDT 2001


"Charles Medcoff" <cmedcoff at home.com> wrote in message
news:rijO6.60718$V5.11537451 at news1.rdc1.mi.home.com...
    ...
> In my mind people don't spend enough time thinking about communicating
with
> the next developer that has to look at your code, especially in the code
> itself, not in supporting documentation.

Young ones don't.  Us old crufties must have come to realize
the need to communicate *to OURSELVES a week from now* what
the H**K we had in mind when we wrote this, that, and the
other -- one learns not to be too clever and tricky &c AND
to let the code be as direct an expression as feasible of
one's design ideas.  Comments and other supporting docs do
not cut it as they may too easily get out of sync with what
the code is actually doing...


> I confess that I do most of my development in statically typed langauges
> (C++/Java) so maybe that's some of my own experience/bias coming through.

It seems to me that having code directly and explicitly reflect
design intent is just as important whether the language's type
checks happen at compile-time or run-time.  Extreme Programming
(XP) was born in Smalltalk (can hardly be accused of being a
statically typed language) yet emphasizes *clear code* (rather
than tricky code, over-general code, comments, docs, ...) as
one of its cornerstones...


Alex






More information about the Python-list mailing list