Managing Code Complexity by Thinking Functionally
Jack Widman

#Functional_Programming
#Java
#JavaScript
#Python
#OOP
#C#
#Scala
Learn how to think and write code like a functional programmer. With this practical guide, software developers familiar with object-oriented programming will dive into the core concepts of functional programming and learn how to use both functional and OOP features together on large or complex software projects.
Author Jack Widman uses samples from Java, Python, C#, Scala, and JavaScript to help you gain a new perspective and a set of tools for managing the complexity in your problem domain. You'll be able to write code that's simpler, reusable, easier to test and modify, and more consistently correct. This book also shows you how to use patterns from category theory to help bridge the gap between OOP and functional programming.
Over the past few years, functional programming (FP) has been experiencing a renaissance. Many companies are looking for programmers with experience in FP, as languages that were not originally designed to be functional have evolved over time to include functional capabilities: languages such as Java, JavaScript, and Python, to name a few. The push for programmers with functional experience is due, in part, to a perceived improvement in the development process, including a sense that fewer bugs are produced and more extensible and robust code is produced when following the functional way. Whether this is true or not—and whether a greater percentage of the code written in the coming years is functional—will become evident in time. For now, let us consider FP one of a number of paradigms, each with its own pros and cons.
Table of Contents
Chapter 1. What Is Functional Programming?
Chapter 2. Mathematical Preliminaries
Chapter 3. Category Theory and Patterns
Chapter 4. Functional Data Structures
Chapter 5. More on Immutability
Chapter 6. Questions of Concurrency
Chapter 7. Where to from Here?
Who Should Use This Book?
Essentially, all programmers. If you have no experience in FP, but have heard about it and you are curious, or even if you picked up this book in a store without any knowledge of FP, this book will prove useful to you. Experienced FP programmers too, will find something to benefit them. The book dives into the category theory roots of FP in a way not presented in other books on this subject. Finally, programmers with some experience using FP but who want to gain a more advanced understanding of the concepts and theory that make up FP will find much to use and enjoy.
How The Book Is Organized
I endeavor to demonstrate, through various programming languages, how functional constructs can improve our code. However, you will notice that Scala is the frequent language of choice for code examples due to the ease with which functional ideas can be expressed in Scala; the reader will more easily appreciate and understand the functional ideas when they are expressed in the natural way, which Scala allows. For a mini-introduction to Scala, see the Appendix.
Jack Widman’s path to software engineering took a circuitous route. Majoring in Latin in college and studying Roman and Ancient Greek Literature, Philosophy and Music, he then became enamored of Mathematics. Learning, on his own, enough to get into grad school, Jack then completed a Ph.D. in Mathematics at Wesleyan University in Middletown, CT. While there, he learned about programming languages and writing code. With over 20 years of experience writing software, Jack provides consulting services to a wide range of software teams, especially with respect to converting codebases to a functional style of coding. He has both deep knowledge and a passion for the subject.









