You will experience the benefits of functional programming even if your code is not purely functional. In this course, you will learn the building blocks that act as a utility belt in your arsenal, enabling you to write code that's easy to understand, extend, test, and debug. You will get hands-on practice on how to use currying, partial evaluation, map, reduce, filter, recursion, and other functional programming concepts in ES6.
About the Author
Zsolt Nagy is a web development team lead, mentor, and software engineer living in Berlin, Germany. As a software engineer, Zsolt continuously challenges himself to stick to the highest possible standards when improving his own knowledge. The best way of learning is to create a meaningful product on the way. Until you reach this state, the second best way of learning is to share with others what you learned and how you structure your thoughts.
Zsolt is an author of the book and video course ES6 in Practice, introducing you to all meaningful features of ES6. He is also an author of the book The Developer’s Edge – How to Double Your Career Speed with Soft-Skills.
Our objective is to get a feel of the differences between functional programming and other programming styles such as object oriented programming, via a demonstrated code example.
We learn the principles of writing code in functional programming in depth: avoiding side effects by writing pure functions, and using immutable data structure. A code example introduces techniques used in functional programming.
We will summarize the advantages and disadvantages of functional programming, and we will also offset some of the disadvantages with some optimization techniques.
ES6/ES2015 is introduced from a functional perspective, so that we can build on these fundamentals to write clear, compact functional code.
Reading pure functional code is often a riddle. We increase readability with object-oriented and functional techniques: chaining and function composition.
Even though forEach looks like a functional utility, it is not usable when our goal is to write side-effect free code. We should still substitute loops with proper functional constructs. Therefore, it is now time to introduce the map, reduce, and filter operations.
SQL queries often contain filtering conditions. As we will see filtering in action, we will first implement the filter function using reduce. Then we will apply various conditions on our queries to filter our results. We will filter regular joins as well as aggregated results.
This practical exercise will make you think out of the box a bit for understanding how advanced reduce functions can be implemented. We will use the reduce function to create a tree data structure from an array of nodes.
When writing higher order functions in functional style, you will often encounter the technique of currying. You will also need to understand currying for the purpose of understanding a partial application.
You will learn what recursion is in mathematics and in software development. You will also find out about different types of recursion. At the end of this section, we will see how to transfer iterative solutions to recursive solutions using accumulator variables.
You will review the main points learned in this volume in order to place them in your functional programming utility belt.
In this last video, you will construct a learning plan for yourself based on your own goals. You will also get some recommendations that will accelerate your learning curve.
Packt has been committed to developer learning since 2004. A lot has changed in software since then - but Packt has remained responsive to these changes, continuing to look forward at the trends and tools defining the way we work and live. And how to put them to work.
With an extensive library of content - more than 4000 books and video courses -Packt's mission is to help developers stay relevant in a rapidly changing world. From new web frameworks and programming languages, to cutting edge data analytics, and DevOps, Packt takes software professionals in every field to what's important to them now.
From skills that will help you to develop and future proof your career to immediate solutions to every day tech challenges, Packt is a go-to resource to make you a better, smarter developer.
Packt Udemy courses continue this tradition, bringing you comprehensive yet concise video courses straight from the experts.