Jump to ratings and reviews
Rate this book

Refactoring to Collections

Rate this book
"Refactoring to Collections" is a book and video course that teaches you how to apply functional programming principles to write clean, maintainable PHP.

Learn how to use collection pipelines to break down ugly, complex functions into a series of simple transformations, free of loops, complex conditionals, and temporary variables.

The first section of the book focuses on teaching you the theory and fundamentals you need to to start applying functional programming principles to your code.

You'll learn about the difference between imperative and declarative code, how to use higher order functions to remove duplication, and how to reimplement fundamental operations like map, reduce, and filter from first principles.

The second section of the book and the companion screencasts are a deep dive into problem solving with Laravel's Collection library.

Through 15 in-depth examples, we walk through everything from beginner to expert level problems, using advanced operations like zip and transpose, and even extending the library with our own custom transformations.

http://adamwathan.me/refactoring-to-c...

153 pages, ebook

11 people are currently reading
157 people want to read

About the author

Adam Wathan

2 books68 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
60 (74%)
4 stars
17 (20%)
3 stars
3 (3%)
2 stars
1 (1%)
1 star
0 (0%)
Displaying 1 - 9 of 9 reviews
Profile Image for Insolita.
2 reviews
August 16, 2017
Not so well as expected; Describes common map-reduce principles, and gives practical examples for collection usage. It may be look as fantastic for people not familiar with laravel, or laravel newbies; And i was expect that author tell about perfomance cost of this sugar, may be even attach benchmarks. It does not matter for simple projects and web-responses, but may be critical for long running console jobs or highload projects. In my opinion, the price of this book is greatly overstated
Profile Image for Dex.
76 reviews10 followers
June 8, 2017
Es más corto de lo que parece, pero no lo digo como algo malo. Me gusta que vaya al grano, a diferencia de otros libros de programación que siempre te explican toda la historia detrás del lenguaje de programación y te aburren tanto que para cuando apenas van a poner un ejemplo, ya llevas 100 páginas leídas.

No me resulta nuevo el tema de las transformaciones con arrays, pero debo decir que aprendí mucho con este libro. Por una parte, aprendí sobre métodos en las colecciones de Laravel que no sabía que existían, o que no sabía realmente cómo se usan (la documentación oficial puede ser algo confusa); por otra parte, aprendí como resolver mejor ciertos problemas que me he topado al desarrollar y que se abordan en el libro, así como nuevos usos de transformaciones que ya conocía.
Profile Image for Jordon Baade.
1 review
August 15, 2017
Great book, got me hooked on Adam's other courses! The book and video content was concise, to the point, and use interesting real-world examples; I reference it often. It truly showed me the power of utilizing Laravel Collections but also helped me clean up my code from other frameworks and languages. Array utilities are your friend!
Profile Image for Oleg Abrazhaev.
83 reviews9 followers
March 19, 2021
This book opened me the way to do declarative programming in PHP, which I was missing.
Never will use a native array function again.
Profile Image for Jacob Landry.
2 reviews
March 16, 2017
It's going to sound cheesy but: this was life-altering. I'm almost giddy when writing code again as I see my work get cleaner and cleaner, not to mention easier to read. I haven't been this excited about my job in years. Really amazing concept and book, I encourage everyone to give it a shot.
Profile Image for Paul.
4 reviews
June 22, 2016
Really great book. It's easy to read and clearly laid out. Plenty of examples that get progressively more involved as you go through the book. I got a lot out of it, as I'm just starting to use collection pipelines in my code. Real-world examples really help to understand the applications of each higher-order function Adam teaches you.
Profile Image for Recai Cansız.
9 reviews1 follower
February 13, 2024
I have changed my coding style after I have read this book. It will give useful and valuable approach to you in practice. If you read this book, you understand me what I mean.
Displaying 1 - 9 of 9 reviews

Can't find what you're looking for?

Get help and learn more about the design.