liveBook · Manning

Chapter 3: Distinguishing actions, calculations, and data

What you will learn in chapter 3 of Grokking Simplicity

This chapter introduction previews applying the actions, calculations, and data categories to problems and code.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This chapter introduction previews applying the actions, calculations, and data categories to problems and code.

3.1 Actions, calculations, and data

This section defines actions, calculations, and data, then shows how the distinction guides problem solving, coding, and code review.

Key terms: actions, calculations, data, side-effects, pure functions, hidden actions, refactor, referentially transparent

3.2 Actions, calculations, and data apply to any situation

Uses grocery shopping to show how an apparently action-only process contains actions, calculations, and data that can be separated into a clearer model.

Key terms: actions, calculations, data, current inventory, desired inventory, shopping list, inputted, outputted

3.3 Lessons from our shopping process

The section draws lessons from a shopping example about finding actions, calculations, and data, then explains how data gets its meaning and why it is useful.

Key terms: actions, calculations, data, ACD perspective, decisions, planning, facts about events, structure, interpretation, inert

3.4 Applying functional thinking to new code

The section uses CouponDog’s referral-email plan to practice identifying actions, calculations, and data in new code.

Key terms: actions, calculations, data, recommendation count, best, good, bad

3.5 Drawing the coupon email process

The section diagrams a coupon-email process by separating database reads and email sending from the calculations that plan which emails to send.

Key terms: action, data, subscribers, coupons, calculation, list of emails, plan, good coupons, best coupons, subscriber

3.6 Implementing the coupon email process

The section implements a coupon email campaign by representing subscribers, coupons, and unsent emails as data, planning emails with calculations, and sending them with an action.

Key terms: data, coupon rank, JavaScript object, JavaScript array, calculation, selectCouponsByRank(), emailsForSubscribers(), action, function, inputs

3.7 Applying functional thinking to existing code

This section shows how to identify an action in existing code and trace its dependence on time through the functions that call it.

Key terms: action, depends on when it is run, figurePayout(), sendPayout()

3.8 Actions spread through code

This section explains why an action in one function can make its callers actions too, and why functional programmers use actions carefully.

Key terms: actions, functional thinking

3.9 Actions can take many forms

This section shows how to recognize actions in many forms of JavaScript code and why functional programmers try to contain them without eliminating them.

Key terms: actions, calculations, ordering, repetition, data, planning stage, execution stage

3.10 Conclusion

The conclusion connects calculations, data, and actions through planning and execution.

Key terms: actions, calculations, data, plan, decision

3.11 Summary

3.12 Up next…

The section previews the next chapter’s move from identifying actions and calculations to transforming actions into calculations.

Where this is used later

Concepts explained in this chapter

← Chapter 2: Functional thinking in action Chapter 4: Extracting calculations from actions →

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.