Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (36 sloc) 4.16 KB

Book review: Imperative to functional programming succintly

Author: Kasper B. Graversen

This free e-book is highly recommended for people interested in broadening their programming horizon - as well as for beginner functional programmers.


Please show your support by sharing and voting:

Why should you read this book?? Because it explains "how to think functionally", which is very different from thinking imperatively - or object-oriented for that matter. That is why learning F# (or any other functional programming language) will change how you think about solutions the next time you are solving a problem.

​I've been meaning to writing this review for some time now. Reviews are more fun when you have something possitive to say. And I do like this book. It's the kind of book just up my alley:

  • Its succint.
  • it addresses a general subject.
  • And it's free.

It is a short book, and judging by the number of pages, quick read. But it will require time for material to really sink in. Expect to be reading some of the sections more than once. It is unfortunate that this title has so very little exposure in the community. Whenever you see a listing of free F# resources, chances are that this book is not mentioned. I think this is a real shame. Quite possibly this it is due to the "email-wall" you have to penetrate - yes you need to sell your soul and give up your email adress in order to be able to download the book!

All examples of the book are written in F#, but there is little emphasis on the F# language itself. Instead, the book discuss functional programming concepts such as:

  • Currying and Partial application
  • Immutability
  • First-class functions
  • Higher-order functions
  • Function pipelines and composition
  • Recursion
  • Map, filter, and reduce
  • Continuations and Continuation passing style
  • Monads (computation expressions)

These concepts together is what constitute functional programming and hence is the critical path to becoming a proficient functional programmer. I especially enjoyed the section "Function pipelining, partial application, and function composition" explaining the core difference in organizing and composing code.

The writing style is informal and easily digestable. Many places C# is compared and contrasted in order to bring forward a point. Aside from the historic introduction (which I highly disagree more with) the book is a great read. Perhaps the chapter on monads, which do with a few extra examples. But monads is a subject that has proven itself again and again to be impenetratable to many. Since the book was written, the F# language has changed a bit, and there are places where things can be better expressed today. I've already notified the author so perhaps we will be lucky to see a revised version in the future. But it is in no way a deal-breaker.

If anything is missing, it should be the missing elaboration on the things about functional programming that doesn't work in practice. In my experience, there are corners of the language which will give you some nasty surprises when used in production. For example curryin combind with (impure) methods returning unit. But I expect to soon write a blog post focusing on all the traps of functional progrmaming.​

If you haven't already downloaded the book, go ahead and to it now. Happy reading!