from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming

From: Marco Morazan (morazanm at gmail.com)
Date: Tue Feb 17 18:25:39 EST 2009

>> But people are motivated toward pleasure and away from pain, so if learning
>> FP is going to cause too much pain, it's going to be a non starter.
>
> Yes it is painful.
>

I am always shocked to hear stuff like this. Functional programming
exacts a small intellectual price for a great deal of power that
*most* when they discover it feel relieved and a sense of
satisfaction. Yet the myth -- and let's be frank it is a myth -- that
functional programming is hard persists.

Seriously, what is painful about it? Is it painful not to have a
mangled syntax? Is it painful to encourage the use of recursion?
Really, c'mon! Is it painful for functions to be first-class? Is it
painful not to encourage the use of sequencing and
mutation/assignment? Is it painful not to have "for" and "while" as
keywords? Is it painful not to think of state all the time? Is it
painful not to have to manipulate pointers? Is it painful for the
language to properly implement tail calls? Is referential transparency
painful -- most of my students are shocked when I point out to them
that in, say, Java (pick any language that encurages assignment) that
f(x) == f(x) is not always true, which suggest huge gaps in their
education when they learned Java --? Is having macros or continuations
painful?

I am not being cynical here. I know that many pick up bad habits that
become part of muscle memory and then may feel lost at sea using a
different programming language. Is that a short coming of functional
programming? Would any of those lost at sea feel more comfortable
coding in Prolog? Would a Cobol programmer feel more comfortable
programming in Java? Perhaps, it is a shortcoming of our education and
not of functional programming.


-- 

Cheers,

Marco


Posted on the users mailing list.