Does Python really follow its philosophy of "Readability counts"?

Russ P. Russ.Paielli at gmail.com
Wed Jan 14 23:50:23 EST 2009


On Jan 14, 7:37 pm, Paul Rubin <http://phr...@NOSPAM.invalid> wrote:
> "James Mills" <prolo... at shortcircuit.net.au> writes:
> > In fact, Python borrows features from the Functional Paradigm. Does
> > this make it a Functional Language ? No. Why ? Because one of the
> > clear requirements of the Functional Paradigm is that functions
> > cannot have side affects.
>
> I'd say functional programming emphasizes a style that avoids use
> of side effects, but saying "functions cannot have side effects" is
> a bit of an overstatement.  Even Haskell lets you code effectfully
> when necessary, using the type system (IO Monad) to separate
> effectful code from pure code.

I think we need to distinguish here between purely functional
languages and a languages that support functional programming. I would
be even more averse to a purely functional language than I am to a
purely OO language such as Java.

One feature of Ada that I always thought was a good idea is the
distinction between functions and procedures, where functions are
guaranteed to not have side effects. But I don't think Ada allows
advanced functional programming such as passing functions as arguments
to other functions.

Scala combines advanced functional and OO programming very nicely as
far as I can tell (I've read some about it but haven't used it yet). I
don't think it distinguishes between functions and procedures, but it
does allow you to declare function arguments as "val" (value) or
"var" (variable), where the former cannot be modified.

If Scala only had default arguments and argument passing by keyword
(and maybe "continue" and "break"), I think it would be *very* hard to
beat for a very wide range of applications.




More information about the Python-list mailing list