python development practices?

Chris Gonnerman chris.gonnerman at newcenturycomputers.net
Wed Oct 31 00:40:49 EST 2001


----- Original Message ----- 
From: "Peter Wang" <pzw1[nospam]@hotmail.com>


> i don't think data hiding's purpose is to keep rogue programmers in
> line.  it's partly to insulate imperfect development practice (e.g.
> sloppy documentation) and partly to define an interface for a class.
> someone else made the point that this is the purpose of documentation,
> which should be kept up to date; i agree but people will invariably
> look at code, and with python, since the entire code of the class is
> exposed (unless you split off a portion of it into a hidden base
> class), it's doubly enticing to use stuff you're not supposed to.
> also, code can be legacied and documentation will fall short.  in
> those cases, the python interpreter is not the code maintainer's
> friend.
> 
> i've no doubt about the power of python when used with rigorous
> development practices.  my question, i guess, is really whether python
> is efficient/effective if used without perfect development practices.

You can always ball up the code, in any language, if you are sloppy
enough, or if you have alien mental patterns... I've worked on too many
of those; I spent four years in the Air Force maintaining the amazing
but fragile REXX code of a man who insisted that everyone call him Crazy.

> if the documentation is a little out of date.  or if a certain
> interface isn't fully spec'ed out.  and the guy who wrote the code is
> out of town for a week.  are there good practices which safeguard
> against these situations?  (beyond perfect development process...)

A programmer with any grounding at all in good design principles and
who is comfortable with Python generates better code *on the average*
than about any other programmer in my experience... where "better" ==
"more readable and less buggy".

> oh, and the underscore thing seems a bit of a hack in that it
> contradicts one of the core principles of python.  decreasing
> readibility of the code in order to express class properties to the
> interpreter just screams "bolted on".

I'm not at all sure that it decreases readability.  Perhaps it does
make the code a bit uglier, but still quite readable.







More information about the Python-list mailing list