layout: series_index
title: “The ‘Why use F#’ series”
seriesIndexId: “Why use F#?”
This series of posts will give you a guided tour through the main features of F# and then show you ways that F# can help you in your day-to-day development.
- Introduction to the ‘Why use F#’ series. An overview of the benefits of F#.
- F# syntax in 60 seconds. A very quick overview on how to read F# code.
- Comparing F# with C#: A simple sum. In which we attempt to sum the squares from 1 to N without using a loop.
- Comparing F# with C#: Sorting. In which we see that F# is more declarative than C#, and we are introduced to pattern matching..
- Comparing F# with C#: Downloading a web page. In which we see that F# excels at callbacks, and we are introduced to the ‘use’ keyword.
- Four Key Concepts. The concepts that differentiate F# from a standard imperative language.
- Conciseness. Why is conciseness important?.
- Type inference. How to avoid getting distracted by complex type syntax.
- Low overhead type definitions. No penalty for making new types.
- Using functions to extract boilerplate code. The functional approach to the DRY principle.
- Using functions as building blocks. Function composition and mini-languages make code more readable.
- Pattern matching for conciseness. Pattern matching can match and bind in a single step.
- Convenience. Features that reduce programming drudgery and boilerplate code.
- Out-of-the-box behavior for types. Immutability and built-in equality with no coding.
- Functions as interfaces. OO design patterns can be trivial when functions are used.
- Partial Application. How to fix some of a function’s parameters.
- Active patterns. Dynamic patterns for powerful matching.
- Correctness. How to write ‘compile time unit tests’.
- Immutability. Making your code predictable.
- Exhaustive pattern matching. A powerful technique to ensure correctness.
- Using the type system to ensure correct code. In F# the type system is your friend, not your enemy.
- Worked example: Designing for correctness. How to make illegal states unrepresentable.
- Concurrency. The next major revolution in how we write software?.
- Asynchronous programming. Encapsulating a background task with the Async class.
- Messages and Agents. Making it easier to think about concurrency.
- Functional Reactive Programming. Turning events into streams.
- Completeness. F# is part of the whole .NET ecosystem.
- Seamless interoperation with .NET libraries. Some convenient features for working with .NET libraries.
- Anything C# can do…. A whirlwind tour of object-oriented code in F#.
- Why use F#: Conclusion. .