I recently read F# for C# Developers by Tao Liu. As usual, the disclaimer is that I received a copy of the book for free in return for the review. This one was a challenge. Not because of the programming paradigm shift from imperative driven programming in C# to functional programming in F#, but because the density of the book and my having read a different book on F# rather recently.
Mr Liu is most certainly an expert on F#, both from his work at Microsoft and this book. However there were times when I felt a little frustrated in reading the book. My favourite chapter of this book was Chapter 3 where he examines design patterns which can be found in C# and then applies these patterns to F# code. It remains dense reading, but it demonstrates those patterns very well. Mr Liu takes the notion, as I read this, of showing you how to do something you typically do in C# and redo it in F#. The biggest question about the code samples included is why do I want to? Unlike other books I’ve read where the idea of functional programming and how it can do more in fewer lines can easily be demonstrated with examples like a quick Fibonacci Sequence; many of his earlier examples really don’t show any savings in coding at all. They do demonstrate that if you can do something with C#, you can also do the same thing with F#, but really I never got a lot of benefit analysis or convincing as to why I want to do this at all.
To me, this book really is written for a programmer who has started hearing more about F# and wants to know what could be done with it and wants to get his or her feet wet with the language. I have a feeling if I would have read this before the other O’Reilly book I reviewed on F#, I would have been far more impressed with it and gotten a tonne more out of it. It’s a good book, well written and full of exemplar code which builds on itself, but I felt like I’d covered too much of the same ground with a better guide earlier. That should not, in any way, dissuade a C# programmer who is curious from picking up the book. However, if you have a good deal of exposure to F# through other avenues, this will be a bit redundant.
My recommendation is if you want to get started, get this, then graduate to the other book I reviewed a while back. Both books will make more sense that way!