For review: PEP 308 - If-then-else expression

Carlos Ribeiro cribeiro at mail.inet.com.br
Sun Feb 9 18:31:33 CET 2003


On Saturday 08 February 2003 18:53, Jp Calderone wrote:
>   No, it's what structured program is *all* *about*.  Picking useful pieces
> of behavior out and abstracting them (often with a function).  Furthermore,
> say you make a mistake (unlikely in *this* trivial case, I admit).  Do you
> want to fix it in one place, the condsqrt function definition, or in 30
> places, in 15 different source files?
>
>   No, splitting algorithms up is a very *good* idea.

Is a good idea as long as the code snippet is actually reusable, and has a 
meaning on its own. There are several cases where the code isn't going to be 
reused - it's going to be called from a single location - and where the full 
understanding of its meaning depends on the context from where it has been 
called. In this case, it's not modularization, but 'code shuffling' (in 
analogy to shuffling a deck of cards).


Carlos Ribeiro
cribeiro at mail.inet.com.br





More information about the Python-list mailing list