Becoming Functional - Helion
ISBN: 978-14-919-4750-0
stron: 152, Format: ebook
Data wydania: 2014-07-02
Księgarnia: Helion
Cena książki: 92,65 zł (poprzednio: 107,73 zł)
Oszczędzasz: 14% (-15,08 zł)
If you have an imperative (and probably object-oriented) programming background, this hands-on book will guide you through the alien world of functional programming. Author Joshua Backfield begins slowly by showing you how to apply the most useful implementation concepts before taking you further into functional-style concepts and practices.
In each chapter, you’ll learn a functional concept and then use it to refactor the fictional XXY company’s imperative-style legacy code, writing and testing the functional code yourself. As you progress through the book, you’ll migrate from Java 7 to Groovy and finally to Scala as the need for better functional language support gradually increases.
- Learn why today’s finely tuned applications work better with functional code
- Transform imperative-style patterns into functional code, following basic steps
- Get up to speed with Groovy and Scala through examples
- Understand how first-class functions are passed and returned from other functions
- Convert existing methods into pure functions, and loops into recursive methods
- Change mutable variables into immutable variables
- Get hands-on experience with statements and nonstrict evaluations
- Use functional programming alongside object-oriented design
Osoby które kupowały "Becoming Functional", wybierały także:
- Język C. Kurs video. Praktyczne wprowadzenie do programowania 98,98 zł, (39,59 zł -60%)
- Internet rzeczy. Podstawy programowania aplikacji i serwer 99,00 zł, (49,50 zł -50%)
- Nowoczesny C. Przegl 119,00 zł, (59,50 zł -50%)
- Efektywny C. Wprowadzenie do profesjonalnego programowania 69,00 zł, (34,50 zł -50%)
- Język C. Solidna wiedza w praktyce. Wydanie VIII 199,00 zł, (99,50 zł -50%)
Spis treści
Becoming Functional eBook -- spis treści
- Becoming Functional
- Preface
- Who Is This Book For?
- Math Notation Review
- Why Functional over Imperative?
- Why Functional Alongside OOP?
- Why Functional Programming Is Important
- Conventions Used in This Book
- Using Code Examples
- Safari Books Online
- How to Contact Us
- Acknowledgments
- 1. Introduction
- Overview of Concepts in Functional Programming
- First-Class Functions
- Pure Functions
- Recursion
- Immutable Variables
- Nonstrict Evaluation
- Statements
- Pattern Matching
- Functional Programming and Concurrency
- Conclusion
- Overview of Concepts in Functional Programming
- 2. First-Class Functions
- Introduction to XXY
- Functions as Objects
- Refactoring Using If-Else Structures
- Refactoring Using Function Objects to Extract Fields
- Anonymous Functions
- Lambda Functions
- Closures
- Higher-Order Functions
- Refactoring get Functions by Using Groovy
- Conclusion
- 3. Pure Functions
- Output Depends on Input
- Purifying Our Functions
- Side Effects
- Conclusion
- Making the Switch to Groovy
- 4. Immutable Variables
- Mutability
- Immutability
- Conclusion
- 5. Recursion
- An Introduction to Recursion
- Recursion
- Tail Recursion
- Refactoring Our countEnabledCustomersWithNoEnabledContacts Function
- Conclusion
- Introducing Scala
- 6. Strict and Nonstrict Evaluations
- Strict Evaluation
- Nonstrict (Lazy) Evaluation
- Laziness Can Create Problems
- Conclusion
- 7. Statements
- Taking the Plunge
- Simple Statements
- Block Statements
- Everything Is a Statement
- Conclusion
- 8. Pattern Matching
- Simple Matches
- Simple Patterns
- Extracting Lists
- Extracting Objects
- Converting to Pattern Matches
- Conclusion
- 9. Functional OOP
- Static Encapsulation
- Objects As Containers
- Code as Data
- Conclusion
- 10. Conclusion
- From Imperative to Functional
- Introduce Higher-Order Functions
- Convert Existing Methods into Pure Functions
- Convert Loops to Tail/Recursive-Tail Methods
- Convert Mutable Variables into Immutable Variables
- What Next?
- New Design Patterns
- Message Passing for Concurrency
- The Option Pattern (Extension of Null Object Pattern)
- Object to Singleton Method Purity
- Putting It All Together
- Conclusion
- From Imperative to Functional
- Index
- Colophon
- Copyright