Why functional Python matters

Tj tj_scarlet at yahoo.com
Wed Apr 16 14:50:11 CEST 2003


Alexander Schmolck <a.schmolck at gmx.net> wrote in message news:<yfs7k9vcu2p.fsf at black132.ex.ac.uk>...
> I think your life might be much happier if you just went to
> http://www.drscheme.org/, dowloaded Dr Scheme and used *that* for
> webdevelopment. 

I don't know what it is, but while I learn a lot from those lispish
languages, I never use them in practice.  So much community
fragmentation, and Dr. Scheme seems to want you to differ from the
standard.  I find it more effective to work around Python's functional
inexactness.

I can't really live without lambda since it's a keyword.  But
map/filter/reduce can be done without since I can just express them as
libs.  In fact, "reduce" is one of those terrible lisp names (for
fold-left) that explain nothing.  Lambda could also stand renaming;
Pythonistas probably think it's an arrogant name.  (Or exotic?  I
can't tell.)

The main advantage of functional constructs is that they're a readable
way to get things done in less lines.  Less lines is more important
because Python is a whitespace language, and for that you want your
functions to be concise.  Otherwise you can start to lose your way. 
As far as readability, I think it's more readable than all those for-
and while-loops.  Not having to name simple functions is more
readable.  The only thing is that people used to C programming find it
disorienting to deal with lists as a central thing rather than some
annoyance to package up a bunch of elements.

In my code, I'm almost always handling lists of things.  It's like, if
what I'm doing is useful for one thing, it's probably useful for a
lot.

Tj




More information about the Python-list mailing list