[Haskell-cafe] Re: map and fmap
duncan.coutts at worc.ox.ac.uk
Tue Aug 15 08:49:24 EDT 2006
On Tue, 2006-08-15 at 12:38 +0200, John Hughes wrote:
> One thing I've observed repeatedly is that many students in later
> years, who learned functional programming early, have a strong
> impression that functional languages are only suitable for toy
> programs. Of course, that's because in their first courses they only
> SAW toy programs. But perhaps, they also moved on to Java as soon as
> they started to build GUIs, and as a result have the impression that
> you CAN'T build a GUI in the functional language they learned first.
Yes, this was the same impression my colleagues had as undergraduates
and it's the same thing I see in the students I now teach.
> This is a very negative impression for students to have, and one that
> is hard to combat because beginning undergraduates are sceptical to
> functional languages from the word go: they "know" they really want to
> learn C++ or Java, and wonder initially what we're playing at.
> I combat that--successfully--by showing them early on that Haskell
> *is* a "real" programming language, in which one can build real
> applications. I tell them about darcs, or whatever new application is
> hot at the time. I show them how to build a GUI in wxHaskell--in the
> fifth week of their university studies.
Yay! I'm doing the same thing, the fifth week in their first term in
their first year. Though I'm using Gtk2Hs of course :-)
I don't make them build the GUI directly of course. I've got a practical
where they do some list processing functions and we provide a GUI module
which visualises what they've done. So while still teaching the basics I
try to make it clear that that can do GUIs and do them easily and make
them look attractive.
This year I want to add an optional extension to go 3D, to visualise
their stuff with singing dancing rotatey things. I managed to get the
Gtk2Hs+HOpenGL stuff working by the end of the practical last year and
had lots of students come over to say "wow!". So I'm looking forward to
using it this year to motivate the students to do the optional sections
of the practical.
> I want them to be frustrated at how difficult GUI programming is when
> they do it in Java (:-)! It works--some find it very hard, but many of
> the good students go much further than my lectures and exercises, and
> reappear in the third and fourth years as very expert and enthusiastic
> Haskell programmers.
This is the first year when people who did my Haskell GUI practical will
go on to the OOP course which involves building a GUI in Java. I'll be
interested to see how they think it compares.
More information about the Haskell-Cafe