March 2017
Intermediate to advanced
264 pages
7h 26m
English
So far, we’ve taken a thorough tour of what Swift offers for object-oriented development. In a lot of languages, that would be enough. But in Swift, it’s only half the story.
Swift is great for object-oriented programming, but it also allows for more of a functional programming style. In functional programming, there’s an emphasis on passing data around, instead of maintaining state in classes and mutating it all the time.
One significant trait of functional programming is that it’s better to pass values to and from functions, rather than references. If we have an object of some class, and two parts of our code can modify its data at the same time, it can lead to confusing bugs. In functions, we generally want to pass the ...