Chapter 1. Thinking differently

 

This chapter covers

  • Understanding functional programming
  • Increasing productivity with functional ideas
  • Writing efficient and readable code
  • Implementing your first F# application

Functional languages are expressive, accomplishing great feats using short, succinct, and readable code. All this is possible because functional languages provide richer ways for expressing abstractions. We can hide how the code executes and specify only the desired results. The code that specifies how to achieve the results is written only once. Thanks to the rich abstractions, we can hide all the complexity in libraries.

This different approach to programming has far-reaching implications for real-world applications. This way of expressing logic makes programs readable and easy to reason about, thus making it possible to understand and change previously unknown code. Functional programs are easy to test and refactor. Yet despite these benefits, functional languages have largely been ignored by mainstream developers—until now. Today we’re facing new challenges. We need to write programs that process large data sets and scale to a large number of processors We need to deal with ever larger systems, so we have to get a better handle on their complexity. These trends open the door to functional languages. But they are far from being the only reason for using functional programming.

1.1. What is functional programming?

1.2. The path to real-world functional programming

1.2.1. Functional languages

1.2.2. Functional programming on the .NET platform

1.3. Being productive with functional programming

1.3.1. The functional paradigm

1.3.2. Declarative programming style

1.3.3. Understanding what a program does

1.3.4. Concurrency-friendly application design

1.3.5. How functional style shapes your code

1.4. Functional programming by example

1.4.1. Expressing intentions using declarative style

1.4.2. Understanding code using immutability

1.4.3. Writing efficient parallel programs

1.5. Introducing F#

1.5.1. Hello world in F#

1.5.2. From simplicity to the real world

1.6. Summary