© Adam L. Davis 2020
A. L. DavisModern Programming Made Easyhttps://doi.org/10.1007/978-1-4842-5569-8_10

10. Functional Programming

Adam L. Davis1 
(1)
Oviedo, FL, USA
 

Functional programming (FP) is a programming style that focuses on functions and minimizes changes of state (using immutable data structures). It is closer to expressing solutions mathematically, rather than through step-by-step instructions.

In FP, functions should be “side-effect free” (nothing outside the function is changed) and referentially transparent (a function returns the same value every time when given the same arguments). For example, this would allow values to be cached (saved in memory).

FP is an alternative to the more common imperative programming, which is closer to ...

Get Modern Programming Made Easy: Using Java, Scala, Groovy, and JavaScript 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.