All software design is composition: the act of breaking complex problems down into smaller problems and composing those solutions. Most developers have a limited understanding of compositional techniques. It's time for that to change.
In "Composing Software", Eric Elliott shares the fundamentals of composition, including both function composition and object composition, and explores them in the context of JavaScript. The book covers the foundations of both functional programming and object oriented programming to help the reader better understand how to build and structure complex applications using simple building blocks.
You'll learn:
•Functional programming •Object composition •How to work with composite data structures •Closures •Higher order functions •Functors (e.g., array.map) •Monads (e.g., promises) •Transducers •Lenses
All of this in the context of JavaScript, the most used programming language in the world. But the learning doesn't stop at JavaScript. You'll be able to apply these lessons to any language. This book is about the timeless principles of software composition and its lessons will outlast the hot languages and frameworks of today. Unlike most programming books, this one may still be relevant 20 years from now.
This book began life as a popular blog post series that attracted hundreds of thousands of readers and influenced the way software is built at many high growth tech startups and fortune 500 companies.
In some other dimension, if I hadn't been exposed to functional programming (FP) in a non-strict fp language (read ES6) , this book would have been straight 5-star - I think it's a great introduction to functional programming in Javascript (at the very least), if you've never encountered the paradigm before. Otherwise, it feels like preaching to the choir. One thing I'd commend on though is that, unlike other FP-fundamentalists, Eric doesn't treat Object Oriented Paradigm with unnecessary disdain, he engages with it sufficiently before showing how a FP approach in javascript is ultimately more beneficial. The book also highlights TDD(Test-driven development) showing how an FP approach simplifies TDD. However, one of the weakest chapter has to be the Monads - it's as if Eric intended for to be merely a teaser rather than the entire serving. Overall, for Javascript developers, I'd recommend that you start with the book "Function Programming in Javascript" from Manning, get familiar with the key fp js libraries before engaging with this book. Cheers!
Дуже непогана книжка з поясненняями в рідному джаваскріпті. прояснив собі краще монади, функтори, трансдюсери та абстрактні типи данних загалом. Сподобались думки щодо потрібності деяких речей в JS (класи і інші спроби зробити мову схожою на інші "тру" ООП мови). Хотілось би більше структурованості і глибини - деякі розділи написані так шо здається от-от ти дійсно добре в'їдеш в тему і о-па починається наступний розділ зовсім про інше. При цьому я не впевнений, що підійде як вступ в ФП для чайників, по тій же причині - деколи перехід від простих речей до складних є дуже різкий. а може це все не так, а я просто читав книжку з переривами. :)
T dừng đọc lúc � 67%. Pure function, functor, monad vẫn còn hiểu và thấy áp dụng. Đến map reduce là chịu vì khó. Curry function khá hay v� lý thuyết nhưng t chưa dùng thực s� thành thạo. Chắc có l� lúc nào có tình huống gặp s� tham khảo lại sách 1 lần nữa.
In terms of content its a mixed bag, maybe as a result of originating as a collection of blog posts:
The examples were kind of repetitive in many places and hard to follow when really needed to illustrate - mostly down to heavy use of nested "fat arrow" syntax.
Function and object composition and general software engineering principles were will done and some JS specifics like new rest/spread syntax.
But didn't think the hard stuff - Monads and particularly Kleisli composition - was at all well explained, at least I didn't come away having grokked the pattern and appreciating the underlying usefulness of adopting this approach. Building Lens from the ground up wasn't helpful either - would have preferred if the author had chosen to motivate examples with Ramdjs and deconstruct that.
For grokking functional programming with JS it is hard to beat Luis Atencio's book.
Book comes as a bound A4/Letter format - which is unusual for software engineering books - but the large print was easy on the eyes.
When books contain dense, area-focused technical information, I take my time with them. That's what happened with this book. As a self-taught, software engineer, this book contained essential computer science terms and techniques re:ease of composing, functional software (mostly using JavaScript examples, so running the examples in the console log is prime time).
I leave you with some notes from the book, "some" because I started taking notes half-way through reading this book. Here are my notes:
Here is the link for the Medium article series that were used to write this book (open-source link):
I quickly read this book because I already learned about FP in my adventures around Haskell and during the read I had mixed feelings :)
The good parts: - a gentle introduction to some important concepts of OOP and especialy FP (immutability, higher order function, currying... even functor, monad, lenses, transducers) - the author has a good historical knowledge of OOP and FP which convey good perspective - The "elements of style" chapter is gold when you know that naming and readability are ones of the hardest things in computer science
The bad parts: - somewhat at some point the concepts are too much simplified - I know that JS is a Scheme at its heart but its a language which tries to do a lot without much rigor and trying to explain paradigms and (difficult) concepts with it is sometimes very ankward (especially lenses).
Finally I think the best way is to learn on a real Typed FP language and then come back to JS with this knowledge. Maybe a more challenging journey but somewhat more robust ;)
A great book that doesn't just teach you Functional Programming (FP) in JavaScript, but rather teaches you Software Composition using FP. As Eric Elliot put it in the book:
You are always composing software. You just do it better when you know you are doing it.
The book explains FP step-by-step, taking you through a lot of examples, to help you understand the concept a lot better.
This book does not try to prove that FC is better than OOP, or any other programming paradigms, but rather teaches you FP in the hopes that you will be able to integrate it well with other programming paradigms to simplify your code.
En realidad es una colección de blogposts sobre programación funcional abarcando diferentes temas:
- Funciones puras - Composición de funciones - Functores - Monadas - Lentes funcionales - Transductores - Testing y mocking
Por ser una colección de posts escritos independientemente, se repite bastante información básica, por lo que la experiencia del libro no es tan disfrutable.
En los temas difíciles me perdí bastante, creo que hicieron falta mejores ejemplos junto con explicaciones más sencillas. Lo recomiendo solamente si eres muy nuevo en la programación funcional, sin ponerle mucho empeño a los temas como functors, monads y transductors.
It's a very interesting book and I learned a lot about functional programming and his different philosophies. That being said, it's very easy to get confused by the examples. Maybe I'll read it again some day when my JavaScript are even more advanced, but I think it's a really good attempt at trying to explain those difficult functional programming concepts, but it's not for everyone.
A bit repetitive in places, but there were a lot of interesting points to take away and think about. It helped solidify my thoughts on functional programming and composition specifically, and gave me an introduction to functors, monads, and transducers that I'm sure will help inform further learning on these topics.
I'm sure I'll be revisiting this book again in the future.
I agree with all the commenters on that it has a lot of repetition and it feels like a collage of many articles and blog posts (which it actually is). Nevertheless it has been helpful in my learning and understanding of functional programming.
Not being a JavaScript developer, maybe I cannot really appreciate this book. I did find interesting te first, more general part, that talks about functional programming concepts.