O'Reilly logo

Swift High Performance by Kostiantyn Koval

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Functional programming

In the functional programming paradigm, a function has a type and it is treated in the same way as other types, such as Int, String, and Class. The function can be assigned to a variable, passed as an argument to another function, and returned from a function as a result type. The main goal is to split the code into small, standalone functions. The perfect function has no side effects and operates only with arguments that were passed to it.

In the functional programming style, you describe what you want to do and not how you want to do it.

Functional programming is great for data transformation and data manipulation. This is because you are able to split code into smaller parts. You can often reuse some routine boilerplate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required