Software has two ingredients: opinions and logic (=programming). The second ingredient is rare and is typically replaced by the first.
I blog about code correctness, maintainability, testability, and functional programming.
This blog does not represent views or opinions of my employer.

Thursday, July 5, 2012

Imperative curlies 9: Haskell


If you read any of my posts about bashing curly braces and you worked with Haskell then I am sure you have thought: wait until someone shows Haskell to this guy. Well you have been right.

I am reading Learn Youa Haskell for Great Good! by Miran Lipovaca. My pride got bruised because of the book subtitle: Beginners Guide. The guy showing me Haskell is a university student from Slovenia. I may have been a bit skeptical when buying a copy but I am more than happy. If only any of the semantic web writers knew how to write as well as Miran (my semantic web reading or struggling through it is another story).

Haskell learning in many ways revalidates my opinions.  The concept sitting behind curly braces in Java practically does not exist in Haskell. 
If you see curly braces {} in Haskell you probably reading record syntax.  The underlying dislike of the imperative code simply permeates throughout the language.

I think learning Haskell is a must do exercise for every imperative programmer like myself. It is an eye opening experience to see a language where if-else statement (even though unpopular in Haskell) is really a function (well so it is in SCALA, but it is more in Haskell ;). You will start thinking of Java if statements as ugly conditional side-effects.  You will think of Java for-loops as ordered collections of side-effects. You will because, well, they are.

So go get the book and enjoy it as much as I do.

5 comments:

  1. Nice & Informative Blog !
    you may encounter various issues in QuickBooks that can create an unwanted interruption in your work. To alter such problems, call us at QuickBooks Technical Support Phone Number 1-(855) 550-7546 and get immediate technical services for QuickBooks in less time.

    ReplyDelete
  2. Hey Nice Blog !
    Our team at QuickBooks Customer Service have been serving QuickBooks users for the past few years in light of the Corona Crisis. 

    ReplyDelete
  3. Thank you very much for your great information. It really makes me happy and I am satisfied with the arrangement of your post. If you face any QuickBooks Error, you may Contact:QuickBooks Support phone numberFor solution.

    ReplyDelete
  4. Nice Blog !
    Our team at QuickBooks Phone Number offers a full guarantee on all the services in the aftermath of increasingly frequent and extreme times.

    ReplyDelete