[Tutor] Functional Programming

Alan Gauld alan.gauld at freenet.co.uk
Fri Jul 7 12:15:27 CEST 2006


> Also, much as I like python, it's not really suited to functional 
> programming

I'd modify that to say its not ideally suited to FP, but an FP style 
is
certainly possible. Pyhon is adequate to learn the principles but it 
would
be nearly impossible to write a real world solution using pure FP
in Python.

> That said, functional programming is fun, and these days probably 
> the best
> introductions are either SML books or Haskell.

Or good old Lisp. And there are lots of good introductory tutorials 
for
Lisp whereas the FP material tends to be very math oriented, if you
don't have a strong math background it simply won't make much sense.

> I also think that having an understanding of functional programming 
> will
> generally improve someone's code, but I would suggest that learning 
> the ideas
> in a language where functional programming is the norm rather the 
> exception
> is a good idea. The come back to python, and learn to undo your 
> recursive
> instincts!

This is good advice if you want more than just an appreciation of the
concepts. If you want to try writing a real world application using FP
then definitely try Lisp, ML or Haskell. But be prepared for a 
completely
different division of your time over the project, much more time up 
front
thinking about the specification of the problem, much less time 
debugging
the functionality (the same amount of time debugging the detailed
code though!)

Alan G. 




More information about the Tutor mailing list