liveBook · Manning

Chapter 1: Welcome to Grokking Simplicity

What you will learn in chapter 1 of Grokking Simplicity

This chapter introduction previews the topics and perspective the chapter will cover.

After this chapter you will be able to

Section by section

Introduction

This chapter introduction previews the topics and perspective the chapter will cover.

1.1 What is functional programming?

This section defines side effects and pure functions, then explains why a common definition of functional programming does not fully describe its practical use.

Key terms: side effects, return value, global state, pure functions, arguments, mathematical functions, functional programming, impure functions

1.2 The problems with the definition for practical use

The section restates an academic definition of functional programming and introduces, without explaining, its practical shortcomings for working software engineers.

1.3 Problem 1: FP needs side effects

The section explains why functional programming cannot avoid all side effects and defines side effects and pure functions.

Key terms: FP, side effects, pure functions, return value, arguments

1.4 Problem 2: FP is good at side effects

The section corrects the idea that functional programming uses only pure functions by explaining its practical approach to side effects.

Key terms: side effects, pure functions, impure functions, functional techniques

1.5 Problem 3: FP is practical

The section challenges the impression that functional programming is too mathematical to be useful in real-world software.

Key terms: FP, functional programming, definition

1.6 The definition of FP confuses managers

A brief email-service scenario shows why a definition of functional programming centered on avoiding side effects can mislead a manager.

Key terms: functional programming, side effects

1.7 We treat functional programming as a set of skills and concepts

The section frames functional programming as practical, transferable skills and concepts rather than a single definition or a collection of language-specific techniques.

Key terms: functional programming, skills and concepts, object-oriented and procedural code

1.8 Distinguishing actions, calculations, and data

Introduces the three-way classification of code and explains why actions require care about when and how often they run.

Key terms: actions, calculations, data

1.9 Functional programmers distinguish code that matters when you call it

This section separates actions, whose effects depend on when or how often they run, from code such as a sum that does not.

Key terms: actions, sum

1.10 Functional programmers distinguish inert data from code that does work

This section distinguishes inert data from executable calculations and explains why functional programmers generally prefer data when it fits the task.

Key terms: data, calculations, inert, transparent, opaque, actions, tradeoffs

1.11 Functional programmers see actions, calculations, and data

The section introduces a project-management notification scenario to set up a later illustration of actions, calculations, and data.

1.12 Step 1: The user marks a task as completed.

1.13 Step 2: The client sends a message to the server.

1.14 Step 3: The server receives the message.

1.15 Step 4: The server makes a change to its database.

1.16 Step 5: The server makes a decision of who to notify.**

1.17 Step 6: The server sends an email notification.**

The section distinguishes deciding to send an email from actually sending it.

Key terms: action, calculation

1.18 The three categories of code in FP

1.19 Actions

Defines actions as things whose effects depend on when or how many times they run.

Key terms: actions

1.20 2. Calculations

Defines calculations by their predictable outputs and lack of outside effects, and explains why they are easy to test and safe to call.

Key terms: calculations, input, output

1.21 3. Data

This section defines data as recorded facts that are meaningful without being executed and can serve different purposes.

Key terms: data, recorded facts, executable code

1.23 FP works great for distributed systems, and most software written today is distributed

The section explains why distributed software makes functional programming valuable: moving code into data and calculations reduces dependence on unpredictable timing and repetition, while isolating the actions that remain.

Key terms: FP, distributed systems, messages, data, calculations, actions

1.25 This book is practical for software engineering

This section contrasts the book’s practical approach to functional programming with a more academic focus.

Key terms: FP, pragmatic experience, theoretical ideas

1.26 This book uses real-world scenarios

The section says the book uses job-like scenarios to illustrate functional thinking rather than textbook algorithms.

1.27 This book focuses on software design

The section explains why functional programming needs software design principles as programs grow, from individual lines of code to entire applications.

Key terms: architecture, design principles, functional design principles, maintainable

1.28 This book conveys the richness of FP

This section presents functional programming as a long-standing body of principles and techniques that remains relevant despite changes in computing.

Key terms: functional programmers, principles and techniques, functional thinking

1.29 This book is language agnostic

The section explains why the book uses JavaScript examples while teaching functional thinking that applies across languages.

Key terms: language agnostic, functional thinking, JavaScript

1.30 What is functional thinking?

Defines functional thinking as the skills and ideas functional programmers use to solve software problems, then introduces the book’s two areas of focus.

Key terms: functional thinking, skills and ideas

1.31 Part 1: Distinguishing actions, calculations, and data

The section frames functional thinking as separating code into actions, calculations, and data, a distinction related to how easy code is to understand, test, and reuse.

Key terms: actions, calculations, data

1.32 Part 2: Using first-class abstractions

The section introduces passing procedures to other procedures as a practical way to reuse more code.

Key terms: procedures, reuse, passing in procedures

1.33 Ground rules for ideas and skills in this book

The section explains that functional programming is too broad to cover in full and introduces ground rules for selecting practical topics for working programmers.

1.34 The skills can’t be based on language features

Functional thinking can help programmers regardless of whether their language has features designed for functional programming.

Key terms: functional thinking, language-feature agnostic, type systems

1.35 2. The skills must have immediate practical benefit

This section sets immediate practical benefit as a requirement for the functional programming skills taught in the book.

Key terms: immediate practical benefit, actions

1.36 3. The skills must apply regardless of your current code situation

This section explains why functional thinking is practical across existing codebases, programming languages, and everyday software work.

Key terms: functional rewrite, pragmatic choices, functional thinking, JavaScript, object-oriented (OO) language, functional programming, standard definition, side effects

1.37 Conclusion

The conclusion identifies the distinction between actions, calculations, and data as the starting point for practical functional programming across languages and problems.

Key terms: functional programming, actions, calculations, data, practical side of FP, any language, any problem

1.38 Summary

1.39 Up next…

This section previews examples of functional thinking in the next chapter.

Where this is used later

Concepts explained in this chapter

Chapter 2: Functional thinking in action →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.