Tuesday, January 15, 2008

Haskell Impressions, Part I

If religion is the opium of the people and marxism the opium of intellectuals, the search for more expressive languages must be the opium of programmers.

In this regard, Haskell is very alluring. The home page used to describe it as:

Haskell is a general purpose, purely functional programming language featuring static typing, higher order functions, polymorphism, type classes, and monadic effects.

Now a more friendly, less ivory towerish tone has been adopted:

Haskell is an advanced purely functional programming language. The product of more than twenty years of cutting edge research, it allows rapid development of robust, concise, correct software.

If part of the Haskell community has decided to market it to a wider audience, it only stands to gain by creating a positive feedback cycle. If it really is a pragmatic tool, programmers in general will benefit too. One initiative to keep an eye on is the Real World Haskell book, which is currently being written and will be available under a Creative Commons licence.

The concepts behind Haskell seem to be very elegant, a powerful abstraction indeed. But how does the language fare in a real world project? Does it make the “easy things easy and the hard things possible”? I have no idea; I only had a brief contact with the language when I read Graham Hutton's Programming in Haskell some months ago.

The book is a very good introduction to functional concepts in general, and very entertaining. But its purpose isn't to teach you day-to-day Haskell; some areas are covered very briefly, others not at all, as you quickly become aware after lurking a bit on haskell-cafe.

If you happen to read the book, don't skip the exercises: it is easy to think you understood something when you really didn't. The two last chapters, “Lazy evaluation” and “Reasoning about programs,” are especially good, worth the price of the book, as they say.

Monday, January 7, 2008

Programmers & Doctors

When I look at a list of top programming books, I am happy when I find Programming Pearls, by Jon Bentley.

I read it in my freshman year (many years ago, time flies), after a teacher recommended it. The book is brilliant, that I can remember. If you are new to algorithms & problem solving, read it.

Or maybe you're just a little bit rusty (I know I am embarrassingly so). Can you still write a correct binary search? Are your “back of the envelope” estimates accurate enough?

“And what is the best book on debugging you have read,” Bentley mentions being asked. The answer directs us to another great book, The Medical Detectives.

Laymen often don't have the chance to foray into investigative medicine, as anyone who has tried to learn more from his doctor about a diagnosis knows all too well.

This collection of articles Berton Roueché wrote to The New Yorker is nothing short of amazing. The engaging, true stories display insightful reasoning you don't come across every day. As Holmes used to say, “once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth.”

Sunday, January 6, 2008

Mumbo-Jumbo World

I'd like to re-read Francis Wheen's How Mumbo-Jumbo Conquered the World. Alas, I don't have it anymore: I lent it to someone from whom I usually hear lots of mumbo-jumbo arguments. The temptation was simply too strong to resist.

This excellent book paints a remarkably accurate portrait of the delusional state we have reached. Strange cults, voodoo economics, creationism, religious fanaticism, mysticism, alien abductions, anti-evolutionism, post-modernism and general superstition are firmly established among us.

While we may have heard about a handful of notorious statistics or examples of shocking beliefs held by world's rulers, the collection presented in the book is eye-opening, if disheartening.

So what is happening? Wheen believes the values of the Enlightenment, the Age of Reason, are lost to us. The inspiring “Dare to Know” has been twisted into a menacing “Don't dare to think.”

He is right, just look around.