Request for criticism - tell me how to become more Pythonic

Paul Boddie paul at boddie.net
Mon Sep 10 06:14:18 EDT 2001


John Hunter <jdhunter at nitace.bsd.uchicago.edu> wrote in message news:<1rbsklmhlx.fsf at video.bsd.uchicago.edu>...
> My guess is that you are a C programmer, not a C++ programmer.  Right?
> 
> The main 'pythonic' thing that is missing here is object orientation.
> An OO programmer would probably have a class for album which supplies
> methods like 'get_track_list', a class for track which supplies
> methods like 'get_title' and 'get_length', a class for comments, a
> class for command line options, a class for the description file, and
> so forth.

But it really depends on what class of activity one is writing code
for, though, doesn't it? For small, quick tasks, procedural code is
frequently quicker to write and more understandable for other people,
especially for "data processing" tasks.

I would accept, however, that should the author want to include the
functionality in other applications, or to develop the existing
functionality further, an object-oriented solution would be worth
attempting.

Paul



More information about the Python-list mailing list