Suggestions for good programming practices?

Dietmar Lang dietmar at bronko.fh-wedel.de
Mon Jun 24 19:40:42 EDT 2002


Hi,

David LeBlanc wrote:
> The one that always gets me is "lat,lon,timezone = getLocation("seattle")".
> I.E. the ability to return multiple distinct values as opposed to returning
> multiple values in the form of a struct as in C or C++.

I don't consider that a problem, I find it quite useful, because when
you want to use the returned values, you don't have to "rip them out" of
the struct. In an example such as above with the timezones, you might
later want to use the different results in different contexts, where in
my opinion a subscribed object from a struct makes the less readable.

It sometimes, however does make coding or reading code a tad more 
error-prone insofar that at first sight you can't always be sure just
how many objects that call returns.

Greetings,
Dietmar

-- 
I haven't lost my mind -- it's backed up on tape somewhere.



More information about the Python-list mailing list