A great programming book – from arrays to collections, from procedural to functional
PHP developers use arrays all the time and tend to use loops to iterate over the elements in the array and perform some action on them. It’s such a common pattern that it becomes a way of solving programming problems that is automatic and rarely questioned.
But there is a better way.
‘Collections’ are object oriented arrays on steroids. They enable a more human-like way of expressing solutions with less code and less potential for bugs. They also offer the opportunity to write code which is much more in line with the functional paradigm rather than the more typical procedural one.
I’ve really enjoyed the short book ‘Refactoring to Collections‘ which took me down this path. It is incredibly practical and introduces some potentially confusing programming concepts in a very clear and straightforward manner that is easily grasped. Since reading the book I’ve started thinking about programming in a completely different way and really look forward to putting these methods into action.