Chapter 6. Functional Programming and Lazy Operations

In the previous lesson, we looked at strings and substrings. In this lesson, we will take a brief look at functional programming and learn what lazy operations are. We will end this lesson with an important but often overlooked topic: writing Swifty code.

Functional programming is a style of programming which tries to keep things simple by avoiding state, especially mutable state, and using a relatively small set of highly versatile functions/methods which take other functions as input. The Swift Standard Library contains several of these. They often make the code shorter, simpler, and easier to read if you know what they do. They can also free you from the burden of having to come up with names ...

Get Beginning Swift 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.