ENGLISH

Functional Thinking: Paradigm Over Syntax

Book information

Publisher
O'Reilly Media
Year
2014
ISBN
9781449365516
Language
english
Format
PDF
Filesize
6 MB (6799020 bytes)
Edition
1
Pages
180\179
Time added
2020-09-08 16:13:04

Description

If you’re familiar with functional programming basics and want to gain a much deeper understanding, this in-depth guide takes you beyond syntax and demonstrates how you need to think in a new way. Software architect Neal Ford shows intermediate to advanced developers how functional coding allows you to step back a level of abstraction so you can see your programming problem with greater clarity. Each chapter shows you various examples of functional thinking, using numerous code examples from Java 8 and other JVM languages that include functional capabilities. This book may bend your mind, but you’ll come away with a much better grasp of functional programming concepts. - Understand why many imperative languages are adding functional capabilities - Compare functional and imperative solutions to common problems - Examine ways to cede control of routine chores to the runtime - Learn how memoization and laziness eliminate hand-crafted solutions - Explore functional approaches to design patterns and code reuse - View real-world examples of functional thinking with Java 8, and in functional architectures and web frameworks - Learn the pros and cons of living in a paradigmatically richer world If you’re new to functional programming, check out Josh Backfield’s book Becoming Functional. Copyright Table of Contents Preface Chapter Overview Conventions Used in This Book Using Code Examples Safari® Books Online How to Contact Us Acknowledgments Chapter 1. Why Shifting Paradigms Aligning with Language Trends Ceding Control to the Language/Runtime Concision Chapter 2. Shift A Common Example Imperative Processing Functional Processing Case Study: Number Classification Imperative Number Classification Slightly More Functional Number Classification Java 8 Number Classifier Functional Java Number Classifier Common Building Blocks Filter Map Fold/Reduce Synonym Suffering Filter Map Fold/Reduce Chapter 3. Cede Iteration to Higher-Order Functions Closures Currying and Partial Application Definitions and Distinctions In Groovy In Clojure Scala Common Uses Recursion Seeing Lists Differently Streams and Work Reordering Chapter 4. Smarter, Not Harder Memoization Caching Adding Memoization Laziness Lazy Iterator in Java Totally Lazy Number Classifier Lazy Lists in Groovy Building a Lazy List Benefits of Laziness Lazy Field Initialization Chapter 5. Evolve Few Data Structures, Many Operations Bending the Language Toward the Problem Rethinking Dispatch Improving Dispatch with Groovy Clojure’s “Bendable” Language Clojure Multimethods and a la carte Polymorphism Operator Overloading Groovy Scala Functional Data Structures Functional Error Handling The Either Class The Option Class Either Trees and Pattern Matching Chapter 6. Advance Design Patterns in Functional Languages Function-Level Reuse Template Method Strategy The Flyweight Design Pattern and Memoization Factory and Currying Structural Versus Functional Reuse Code Reuse Via Structure Chapter 7. Practical Thinking Java 8 Functional Interfaces Optional Java 8 Streams Functional Infrastructure Architecture Web Frameworks Databases Chapter 8. Polyglot and Polyparadigm Combining Functional with Metaprogramming Mapping Data Types with Metaprogramming Infinite Streams with Functional Java and Groovy Consequences of Multiparadigm Languages Context Versus Composition Functional Pyramid Index About the Author

Similar books