Objc Functional Programming in Swift Download PDF Books - Programming Ebook


Download Programming Ebook

Wednesday, November 22, 2017

Objc Functional Programming in Swift Download PDF Books

Objc Functional Programming in Swift
Objc Functional Programming in Swift

Book Details 
             TitleObjective-C for Swift Developers
         Author: Chris Eidhof, Florian Kugler, and Wouter Swierstra
     Publisher: Chris Eidhof, Florian Kugler, and Wouter Swierstra
    Language: English
        SubjectSwift / Computers & Technology / Programming / Apple Programming
No. of pages: 220
         Format: PDF


Why write this book? There is plenty of documentation on Swift readily available from Apple, and there are many more books on the way. Why does the world need yet another book on yet another programming lan- guage?

This book tries to teach you to think functionally. We believe that Swift has the right language features to teach you how to write functional pro- grams. But what makes a program functional? And why bother learning about this in the rst place?

It is hard to give a precise de nition of functional programming — in the same way, it is hard to give a precise de nition of object-oriented pro- gramming, or any other programming paradigm for that matter. Instead, we will try to focus on some of the qualities that we believe well-designed functional programs in Swift should exhibit:

Modularity: Rather than thinking of a program as a sequence of assignments and method calls, functional programmers empha- size that each program can be repeatedly broken into smaller and smaller pieces; all these pieces can be assembled using function application to de ne a complete program. Of course, this decomposition of a large program into smaller pieces only works if we can avoid sharing state between the individual components. This brings us to our next point.
  • A Careful Treatment of Mutable State: Functional programming is sometimes (half-jokingly) referred to as ‘value-oriented pro- gramming.’ Object-oriented programming focuses on the design of classes and objects, each with their own encapsulated state. Functional programming, on the other hand, emphasizes the importance of programming with values, free of mutable state or other side effects. By avoiding mutable state, functional programs can be more easily combined than their imperative or object-oriented counterparts.
  • Types: Finally, a well-designed functional program makes careful use of types. More than anything else, a careful choice of the types of your data and functions will help structure your code. Swift has a powerful type system that, when used effectively, can make your code both safer and more robust.

We feel these are the key insights that Swift programmers may learn from the functional programming community. Throughout this book, we will il- lustrate each of these points with many examples and case studies.

In our experience, learning to think functionally is not easy. It chal- lenges the way we’ve been trained to decompose problems. For program- mers who are used to writing for loops, recursion can be confusing; the lack of assignment statements and global state is crippling; and closures, generics, higher-order functions, and monads are just plain weird.

Throughout this book, we will assume that you have previous program- ming experience in Objective-C (or some other object-oriented language). We won’t cover Swift basics or teach you to set up your rst Xcode project, but we will try to refer to existing Apple documentation when appropriate. You should be comfortable reading Swift programs and familiar with com- mon programming concepts, such as classes, methods, and variables. If you’ve only just started to learn to program, this may not be the right book for you.

Objc Core Data Download PDF

In this book, we want to demystify functional programming and dispel some of the prejudices people may have against it. You don’t need to have a PhD in mathematics to use these ideas to improve your code! Functional programming is not the only way to program in Swift. Instead, we believe that learning about functional programming adds an important new tool to your toolbox that will make you a better developer in any language.

Current Status of the Book

We approached the process of writing this book very much like we would with developing software: you’re looking at version 1.0. We wanted to get a rst version out around the time Swift hits 1.0, but we will continue to make adjustments, x bugs, and add new content as the language evolves.
Should you encounter any mistakes or would like to send any other kind of feedback our way, please le an issue in this GitHub repository.


We’d like to thank the numerous people who helped shape this book. We wanted to explicitly mention some of them:
Natalye Childress is our copy-editor. She has provided invaluable feed- back, not only making sure the language is correct and consistent, but also making sure things are understandable.

Sarah Lincoln has designed the cover and given us feedback on the de- sign and layout of the book.

Wouter would like to thank Utrecht University for letting him take time to work on this book.

We would like to thank the beta readers for their feedback during the writing of this book (listed in alphabetical order):
Bang Jun-young, Adrian Kosmaczewski, Alexander Altman, Andrew Halls, Daniel Eggert, Daniel Steinberg, David Hart, David Owens II, Eugene Dorfman, f-dz-v, Henry Stamerjohann, J Bucaran, Jamie Forrest, Jaromir Siska, Jason Larsen, Jesse Armand, John Gallagher, Kaan Dedeoglu, Kare Morstol, Kiel Gillard, Kristopher Johnson, Matteo Piombo, Nicholas Outram, Ole Begemann, Rob Napier, Ronald Mannak, Sam Isaacson, Ssu Jen Lu, Stephen Horne, TJ, Terry Lewis, Tim Brooks, Vadim Shpakovski 

No comments:

Post a Comment