Demian Turner’s review reminded me that I’ve been meaning to write a recommendation for Matt Zandstra’s " PHP 5 Objects, Patterns, and Practice" for a few weeks now.
While many of the ‘design patterns’ books I’ve read have been able to impart their core concepts, none has really worked for me in the way Matt’s did. In part that’s because it is the first one I’ve read that’s exclusively PHP-focussed. While I enjoy python more than PHP, PHP tends to be the language I default to due to its familiarity. Matt draws from the example of other languages, but clearly identifies what marks PHP out as a language and applies his techniques appropriately.
Most similar texts to “Objects, Patterns, and Practice” have a tendency to be overly theoretical. In most areas I enjoy getting to grips with theory, so I understand well the tendency to disappear into the logical details while missing the practical, but with something I use on a practical level with such regularity I don’t want to be left with too many “ok, but how do I interface that technique with my web application” questions. I often asked that question as I read this book, but usually found that the next page addressed just that question.
For those who are already regular users of PHP5’s OO facilities, the first few chapters can be skipped over quickly and this book will not come as a revelation, but it is a solid overview and I’ve found myself writing cleaner code since reading it. For those newer to OO (but already comfortable with PHP) this may well be a good introduction to that other paradigm.