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

From: Grant Rettke (grettke at
Date: Tue Feb 17 18:51:30 EST 2009

On Tue, Feb 17, 2009 at 5:25 PM, Marco Morazan <morazanm at> wrote:
>>> 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.

When I feel shocked at what someone says; it is often an opportunity
for me to get to the root of a perspective very different from my own.
It is just a feeling; you know that they can't be trusted.

I don't think what is going on here is very shocking, though. Anything
different from the mainstream will be more difficult to learn just
because it is different.

Now throw on top of that what is considered to me normal, or rather
what is considered not to be normal in the mainstream:

Normal: Object orientation, Design Patterns, C like languages, no
depth or attention to detail, over complexity
Abnormal: HtDP, SICP, attention to detail, thoughtful action, simplicity

The very traits that are lauded in the mainstream offer little help in
seeing the value of FP; or really anything for that matter.

That said, there are a lot of mainstream books that are tailored to
"draw in the masses" to OO. Kathy Sierra's "Head First" books for
example are very appealing to the large. Also Peter Siebel's
"Practical Common Lisp" or the "Real World Haskell" book are what
people want to see so they feel like they are "doing something
valuable" with what they learn. I don't see that in the FP world.

Another example is showing the value of "pure functional programming".
Other than HtDP, I have yet to be able to find a book that teaches how
to, and the value of, designing purely functional programs. I have
asked just about everyone I could find and there is still only one
that I can point too.

It is all about marketing. It isn't about real value; it is about
perceived value.

It would take a FP person writing a hot book and speaking at
conferences and doing all sorts of things to generate hype. That is
how languages "win".

> 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.

Agreed. I feel the same way.

> Yet the myth -- and let's be frank it is a myth -- that
> functional programming is hard persists.

Compared with the mainstream tracks; it has a higher barrier to entry.

> 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?

Strawmen: that is not the point.

> 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?

It doesn't matter whose fault it is; but what matters is how easy you
make it for these lost souls to be saved.

> 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.

No. No. It doesn't matter. What matters is how you sell it.

Posted on the users mailing list.