FOREWORD

There's Left, Right, and there's Center. There's peanut butter, chocolate, and then there's peanut butter cups. C#, Visual Basic...and now there's F#. There have always been effectively only two choices for programmers that target .NET, and for many that's been no choice at all. Take a look at F#. It's a functional language, to be clear, but it's also object-oriented and a bridge between two worlds. It's all the goodness of a peanut butter cup, and more.

To many, F# feels new and dramatic. Its values are rooted not just in some of the first programming languages, but the lambda calculus itself. F# may feel new to you and me, but it's based on 80 years of deep mathematical proof and respected thought.

When the get-er-done programmer hears names like Scheme, OCaml, Haskell, Erlang, and F#, these languages conjure up visions of crazy-eyed computer scientists and bearded hermits. You can't expect to really sell software written in these languages any more than John Grisham can sell a legal mystery written in Latin, right? That's madness.

Actually not. F# needs to be a new tool in your toolbox. Imagine not thinking about variables changing their value. Imagine no global state and no side effects. Imagine not worrying about deadlocks and race conditions because you aren't using any locks. Consider not just testing your application but proving that it works and being able to count on it.

F# reminds us that writing stateful code in a procedural language for a machine that has 12 cores is, well, freaking hard to get right. F# reminds the .NET programmer that there is life beyond the simply procedural. F# gives you this, and the familiarity of the .NET runtime and Base Class Library that you already know how to use. You can write F# not just with .NET on Windows, but also on Xbox 360, Silverlight, and Mono on Linux.

There's another way of thinking out there and it's functional. Study this book's take on F#. It's clear, code-focused, realistic, and pragmatic. This is a real language that you can solve real problems with. I hope you enjoy reading this book as much as I did.

Scott Hanselman

Principal Program Manager Lead — Server and Tools Online - Microsoft

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset