Python's simplicity philosophy
Douglas Alan
nessus at mit.edu
Tue Nov 11 11:05:16 EST 2003
Alex Martelli <aleax at aleax.it> writes:
> Robin Becker wrote:
>> The whole 'only one way to do it' concept is almost certainly wrong.
> Bingo! You disagree with the keystone of Python's philosophy. Every
> other disagreement, quite consequently, follows from this one.
The "only one way to do it" mantra is asinine. It's like saying that
because laissez faire capitalism (Perl) is obviously wrong that
communism (FP) is obviously right. The truth lies somewhere in the
middle.
The mantra should be "small, clean, simple, powerful, general,
elegant". This, however, does not imply "only one way to do it",
because power and generality often provide for multiple "right" ways
to flourish. In fact, trying to enforce that there be only "one way
to do it", will make your language bigger, messier, more complicated,
less powerful, less general, and uglier, as misguided souls rush to
remove powerful and general tools like reduce() from the language, and
fill it up with special-purpose tools like sum() and max().
People have written entire articles on how to do functional
programming in Python:
http://www-106.ibm.com/developerworks/linux/library/l-prog.html
You would castrate Python so that this is not possible? Then you
would diminish Python, by making it a less general, less elegant
language, that has become unsuitable as a language for teaching CS101,
and only suitable for teaching How Alex Martelli Says You Should
Program 101.
|>oug
More information about the Python-list
mailing list