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.