Chapter 4

Defining the Functional Difference

IN THIS CHAPTER

Check Examining declarations

Check Working with functional data

Check Creating and using functions

As described in Chapter 1 and explored in Chapters 2 and 3, using the functional programming paradigm entails an approach to problems that differs from the paradigms that languages have relied on in the past. For one thing, the functional programming paradigm doesn’t tie you to thinking about a problem as a machine would; instead, you use a mathematical approach that doesn’t really care about how the machine solves the problem. As a result, you focus on the problem description rather than the solution. The difference means that you use declarations —formal or explicit statements describing the problem — instead of procedures — step-by-step problem solutions.

Remember To make the functional paradigm work, the code must manage data differently than when using other paradigms. The fact that functions can occur in any order and at any time (allowing for parallel execution, among other things) means that functional languages can’t allow mutable variables ...

Get Functional Programming For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.