Book Review: PHP In Action

Authors: Dagfinn Reiersol, Marcus Baker, Chris Shiflett
2007 Manning Publications
525 pages

This book is geared toward the intermediate PHP developer who wants to bring in aspects of OOP, Testing and Refactoring to help improve the quality of the code they write. It is split into four parts; Basic Tools and Concepts, Testing and Refactoring, Building the Web Interface, and Databases and Infrastructure.

In addition to PHP, I have decent amount of experience with Java and Java web frameworks such as Struts. So as I worked through this book much of the content was familiar to me but from a Java perspective. It was enlightening to see the authors express these same concepts from a PHP perspective. The fact that many times (not always), the implementation in PHP is more concise and elegant that the Java alternative really shows of the power of a dynamically typed language such as PHP. Also the fact that PHP was bred from the beginning to be a web development language gives it a definate advantage in the web arena.
The authors are honest though, they haven’t simply painted implementing OO, TDD, and Refactoring as completelty painless. For instance in the testing portion they’ve devoted quite a bit of time to showing the difficulties of testing (especially in a Web environment). Such as the need for mock objects and the difficulty in keeping mocks “real enough” so they fail and pass as the real object would. This full disclosure is key for readers to estimate if the extra effort of a concept is worth the benefits for their particual situation.

Overall this is great book for the intended audience. It is not “black and white” about the solutions it proposes. Reasonable alternatives are given and the pros and cons of each are expressed. For those with extensive OO experience, some portions of the book may seem trivial but overall it is still worth a “quick scan” to see the specifics of PHP implementations of general OO concepts.

Tagged PHP

Comments (0)

Add a Comment

Meta