[Haskell-cafe] Why Haskell is beautiful to the novice
JK
jerzy.karczmarczuk at unicaen.fr
Sat Aug 29 23:32:04 UTC 2015
Le 29/08/2015 20:59, mantkiew at gsd.uwaterloo.ca a écrit :
> it's clear that Haskell is optimized for functional style and Python for imperative style, and things in their respective opposite styles look clumsy.
I am not entirely sure what is the real meaning of "optimized for" in
your phrasing, but what is clear is that Python 'optimizes' without
being asked for, e.g. when you use generators in order to cascade some
sequence processing, as in the "sum" example, nothing wrong happens,
while lazy lists reserve several nasty surprises. -O2 optimization, or
explicit strictness annotations (and BangPatterns) are there, and may
save our lives, but "what is clear" is that teaching Haskell as a
practical language usable for large data, is quite non-trivial, and its
beauty for novices evaporates quite fast.
[This 'sum' example under GHCi will be problematic anyway].
I taught Haskell so long, that I became reckless, and my students got a
rather tiresome project based on Haskell OpenGL. It was a massacre, a
general unhappiness... Two years later my dept. decided to abandon
advanced Haskell (with monads of all sorts), and left only the 2nd year
introduction to functional programming, its style and algorithmics. I
couldn't defend the "professional Haskell" too hard, the gap between the
elementary FP, and the "true stuff" became too big in the context of our
curriculum.
Just my three cents...
Anyway this threads degenerates a bit, and begins to contain statements
I find dubious, or too restricted, e.g.,
> A beginning student doesn't need to learn OOP in
> any kind of depth.
etc.
I suspect that the author of this phrase was not yet born when I began
to teach programming... Now, I would never dare to declare what a
beginning student *really needs*. Programming is a kind of art, a
fragment of culture, a vision of the world, and the Pursuit of Happiness
is different for different people. Linguists (or historians, etc.) may
*begin* with logic/relational programming, biologists with objects, and
mathematically-oriented yougsters, with FP.
Or not.
Jerzy Karczmarczuk
/Caen, France/
More information about the Haskell-Cafe
mailing list