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 ...

Get Professional F# 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.