[Haskell-cafe] about Haskell code written to be "too smart"
jake at pikewerks.com
Tue Mar 24 14:29:38 EDT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Manlio Perillo wrote:
| These friends are very interested in Haskell, but it seems that the main
| reason why they don't start to seriously learning it, is that when they
| start reading some code, they feel the "Perl syndrome".
| That is, code written to be "too smart", and that end up being totally
| illegible by Haskell novice.
| I too have this feeling, from time to time.
I used to think this as well, but have since changed my mind about most
cases. It is simply the case that Haskell code is extremely dense. The
more powerful your abstractions, the more functionality you can cram
into one line of code. This can give the appearance of being overly
clever, since we are accustomed to clever code being unnervingly short
and using lots of short variable names and operators. It is generally
encouraged to use single-letter variable names in Haskell because there
are many cases that you haven't a clue what the type of that variable
might be, again due to Haskell's amazing ability to abstract such things
away. All these factors combined just means that you have to concentrate
just as hard to understand one line of Haskell as you might 10 or 20
lines of other languages. There is 10 or 20 times the amount of information.
- - Jake
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the Haskell-Cafe