Python's "only one way to do it" philosophy isn't good?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sat Jun 9 02:35:48 EDT 2007


En Sat, 09 Jun 2007 02:49:03 -0300, WaterWalk <toolmaster at 163.com>  
escribió:

> I've just read an article "Building Robust System" by Gerald Jay
> Sussman. The article is here:
> http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf
>
> In it there is a footprint which says:
> "Indeed, one often hears arguments against building exibility into an
> engineered sys-
> tem. For example, in the philosophy of the computer language Python it
> is claimed:
> \There should be one|and preferably only one|obvious way to do
> it."[25] Science does
> not usually proceed this way: In classical mechanics, for example, one
> can construct equa-
> tions of motion using Newtonian vectoral mechanics, or using a
> Lagrangian or Hamiltonian
> variational formulation.[30] In the cases where all three approaches
> are applicable they are
> equivalent, but each has its advantages in particular contexts."
>
> I'm not sure how reasonable this statement is and personally I like
> Python's simplicity, power and elegance. So I put it here and hope to
> see some inspiring comments.

I think the key is the word you ommited in the subject: "obvious". There  
should be one "obvious" way to do it. For what I can remember of my first  
love (Physics): if you have a small ball moving inside a spherical cup, it  
would be almost crazy to use cartesian orthogonal coordinates and Newton's  
laws to solve it - the "obvious" way would be to use spherical coordinates  
and the Lagrangian formulation (or at least I hope so - surely  
knowledgeable people will find more "obviously" which is the right way).
All classical mechanics formulations may be equivalent, but in certain  
cases one is much more suited that the others.


-- 
Gabriel Genellina




More information about the Python-list mailing list