Sat, Jun 13, 2015 

Book Review: The Book of F# by Dave Fancher

I really like LINQ.

LINQ is the functional side of C#, and it’s my favorite part. I love making extension methods so I can keep the dot-chain going. Naturally I was interested in F#. It’s the “functional C#”, right?

This book starts great in chapter 1 with getting setup and ‘writing’ a first app. Happily, it was not another boring “Hello World”: it was a full Reverse Polish Notation calculator! It took up half a page and looked delightfully strange to my C# trained eyes: there were so many things I didn’t understand. Don’t worry if you don’t understand it, Dave says, because this demos all the cool features you get to learn. And then I wanted to read the whole book, just to understand all those awesome new things.

Oddly (but, in retrospect, brilliantly), “Fundamentals” is not chapter 2, it’s 3. Chapter 2 is “F# Interactive.” The FSI is a terminal window in Visual Studio that can run arbitrary pieces of F# code. It’s amazing… well, just read the book. It’s too much for me to explain here, but it’s great. I use it even in C# development if I need a random number or a GUID. Basically any .NET class you can new up (or statically call), you can type into FSI to get a quick output. It’s really handy.

So the big question: have you written anything in F#? I have to hang my head in shame as I answer “no.” But I’m confident that it will be “yes” very soon now that I’ve read this book. I’ve got a hammer and everything is starting to look like a nail.

Disclosure: I won this book in a raffle at a Indy Software Artisans. It has been signed by the author (in pen) and my child (in purple crayon).