[Haskell-cafe] let and fixed point operator
jerzy.karczmarczuk at info.unicaen.fr
jerzy.karczmarczuk at info.unicaen.fr
Thu Aug 30 14:04:06 EDT 2007
Brent Yorgey quotes:
>> It's really maddening to write 50,000 lines of code, eventually get it
>> to compile, run it, and have the program lock up and start consuming so
>> much virtual memory that the entire PC becomes unstable within seconds.
...
> Well, this is why you should test your program in bits and pieces
> before you get to that point. Writing 50,000 LOC before you even run
> your first test is a horrible idea in any programming language.
I would rephrase this in a more brutal way.
Writing 50000 lines of code in a language which seems to be badly mastered
is a suicidary exercice. The let x=f x construct touches the essence of
Haskell, its laziness, and it is used as a co-recursive way to replace
loops. If it appears as the effect of forgetting the prime in x', use
variables with long, meaningful names. This will economize some frustration.
==
An anecdote.
Hundreds of years ago, when I taught programming in Cracow, Poland, we had
some students from Vietnam (North, of course). One of them wrote programs
where *all* variable names were ... you guess it, Vietnamese.
It was easy to remember for him, no errors, no confusion.
The only touchy point in this affair was that my group counted also three
Vietnamese girls, who always when the boy with his poker-face produced
publicly his solution, became red and began to giggle, or shouted angrily
something I couldn't understand.
Had I noted or memorized those programs, I would probably learn a good
collection of particularly succulent Vietnamese swearwords.
==
Perhaps you should decorate your program a bit as well?
Jerzy Karczmarczuk
More information about the Haskell-Cafe
mailing list