Functional Programming in JavaScript teaches JavaScript developers functional techniques that will improve extensibility, modularity, reusability, testability, and performance. Through concrete examples and jargon-free explanations, this book teaches you how to apply functional programming to real-life development tasks. The book includes insightful comparisons to object-oriented or imperative programming, which will allow you to ease into functional design. Moreover, you'll learn a repertoire of techniques including function chaining and pipelining, recursion, currying, binding, functional composition, lazy evaluation, fluent error handling, memoization, and much more. By the end of the book, you'll think about application design in a fresh new way.
About the technology As web developers build increasingly complex applications in JavaScript, the code base for these projects can become exponentially larger and harder to maintain. The result? Application performance suffers, and readability and extensibility are severely compromised. For applications like these, Functional Programming provides a saner approach, allowing you to write elegant, readable code that raises the level of abstraction while being less prone to errors. Although not a "pure" functional language, JavaScript's native functional capabilities unlock access to proven functional programming techniques and practices.
What's inside Foundations of functional programming and design Explore JavaScript's functional programming capabilities and the functional library ecosystem Create more reliable code by embracing immutability Learn to write code that's easier to reason about Separate core logic from program structure to write extensible code Adopt a new approach to error handling and testing Apply functional programming to solve real-world problems About the reader Readers need to be comfortable with JavaScript programming and object-oriented design. No previous experience with functional programming is required.
About the author Luis Atencio is a Staff Software Engineer for Citrix Systems in Ft. Lauderdale, FL. He develops and architects applications leveraging Java, PHP, and JavaScript platforms. Luis is very involved in the community and has presented at local meet-ups. He blogs about software engineering at luisatencio.net and writes articles for PHP magazines and DZone. Follow Luis on twitter at @luijar.
This helped me think approach JavaScript functionally instead of object-oriented. This highlighted a lot of bad coding practices I had been doing, so this helped me clean up my team’s codebase at work and maintain better coding habits. This will be a good reference material going forward.
A good introduction on the subjects of functional programming. Some topics are not explained very well. Some are explained via libraries that became largely obsolete in 2021. I would probably say that THIS IS NOT A BOOK FOR BEGINNERS, but honestly so is the whole topic of declarative functional programming.
Overall I would probably not recommend this book in 2021, however it was very good and useful in 2016.
Quite a good introduction to functional programming. Will teach you some basic concepts that will help you to write more reliable, modular and cleaner code. Recommended for novices in javascript. Maybe little bit less useful for someone who has prior experience with functional programming in languages like haskell, lisp e.t.c.
An excellent and modern introduction to the world of functional programming. The best thing is, this book is filled with practical examples using some of the latest Javascript technologies out there. I highly recommend this book for anyone who is interested in a more thorough understanding of functional programming via the Javascript environment.
This was a great summary of functional JavaScript for developers already used to some JavaScript paradigm or other. For me, it loses a star (if Goodreads did half stars, it would be a half star) purely because it glossed over a few intricacies of pure functional programming for the benefits of those who haven't been exposed to an uncompromising (to the extent that it is possible) language like Haskell. I found myself sending quotes to my Haskell friends and watching them squirm. In the monad discussion of chapter 5, Atencio writes "But you'll see that having a typeless language like JavaScript [...] makes monads easy to read and frees you from having to deal with all the intricacies of a static type system". I don't necessarily agree with presenting types as an obstacle to understand monads. I would've preferred to see the author suggest that the reader explore further, and make their own mind up. That's easy to say in 2019, when typescript is as popular as it is. I read the 2017 edition of Functional JavaScript, which really drove home the sheer speed of iteration of the JavaScript ecosystem. Several references are now no longer considered best practices, and it was nostalgic for me to read about the thus far low adoption rates of what was still then called ES6. Typescript had not yet imbued the JavaScript community with a newfound love of compile time checks. I would love to read a "Functional Typescript" book in 2019 or 2020. These issues should not be problem for the reader without exposure to pure functional strictly typed languages with communities who read category theory theses - Functional JavaScript provides exactly what many JavaScript engineers need to gain utility and speed from functional principles, and I would recommend it to my colleagues.
The cover is a great summation: "How to improve your JavaScript programs using functional techniques."
This is a "gateway drug" for those who write JavaScript and are itching to sprinkle functional concepts into their code and take their JS to the next level.
The book is well structured, starting with motivating examples of converting emperative code into functional code. It's the first time I've seen code that looks similar to what I've written be improved in almost every way. The book constantly highlights the benefits of the techniques it teaches.
This isn't a book about turning you into a functional purist, but it's a set of tools that can be utilised to really improve certain code. Read this if you want to get better, but also want to hear some fresh perspectives.
Since reading this book I've found it far easier to comprehend Haskell. I think writing boilerplate in JS has made it much easier to grok concepts which seem magic in Haskell.
I want to read this book for a very long time since it's basically recommended by a lot of Chinese blogs as the entry level material for functional programming using JavaScript. The book is well organized and all functions well explained using real-life code. I want to give this book 4.5 stars since for chapter 8 the author simply kinda skip Reactive programming using Rxjs just in like 5 pages, I really hope this can be covered in a slightly detailed manner (I know this topic itself can be it's own book but like 20 pages introduction can be a decent and acceptable amount for me to know whether I should buy Rxjs book from Manning). Anyway, since there is no 4.5 stars, I simply put 5 stars here.
This entire review has been hidden because of spoilers.
Pros: - good functional programming foundation Cons: - the language itself is very bad(javascript) - the book is using a couple of libraries to teach some of the core concepts of FP, it would be more useful to build a library from stratch
A wide and yet in-depth instruction of functional programming. Making the paradigm shift from imperative to more functional programming has significantly improved my development skills. At first, it used to hurt my brain to try to think functionally, but refactoring my side projects, writing more functional code at work and reading this book have helped.
Some of the core benefits of functional programming are: - It encourages you to decompose tasks into simple functions, which are more clear and easier to reason about. - Data is processed using fluent chains. - You decrease the complexity of event-driven code by enabling reactive paradigms - Your code is easier to test as a pure function with no side effects have predictable inputs and outputs. - You can write code that doesn't change state and significantly reduce bugs or decrease the complexity in tracking them down.
The book is divided into three parts, Think functionally, which explains the motivation and purpose behind functional programming, with contrasting examples with object oriented programming and more imperative coding practices to help you transition into thinking more functionally. Part 2, Get functional which explores core functional methods and implementations around variation data structures and real-world coding scenarios as well as functional design patterns. Part 3, Enhancing your functional skills, dives into more advanced concepts around error handling, asynchronous code, memoization, recursion and tail call optimizations as well as exploring some creative programming which uses observables to subscribe to asynchronous events and do function actions along this observable stream of data.
Great book. I like how Luis describes functional programming, with providing great examples of functional and OOP. Examples are very clear and up to the point. I'm learning so much from this book about functional programming.
4.5/5 -- Wonderful, albeit shallow at times, coverage of functional programming as it exists in JavaScript. Half a point off for numerous code typos and bugs.
Quite enjoyed this book! I find now that I'm practicing functional JS that my level of enjoyment working in JS is significantly improved. Very much liked learning about the Ramda library. Would like to have seen more on RxJS, but of course there's another book for that.