Refactoring to Collections by Adam Wathan

September 7, 2023

A case for declarative programming illustrated with Collections.

I’m many years late getting to this, but it was still a great read!

It was not a glorification of Collections, but a hands-on case for declarative programming and clear expression. If you enjoy refactoring and writing elegant code—not merely code that gets the job done—you may also be inspired and energized reading this book.

Adam manages to be thorough, illustrative, and somehow concise with a casual, good-humored writing style. The bulk of it is a stroll through opportunities to write better code with Collections, with examples building on each other and exploring the same principle in different ways.

It’s not strictly about Laravel Collections, though: you could easily take inspiration from the thinking here and use it in whatever language you want.