Categories


Archives


Recent Posts


Categories


PHP: The Right Way; A Review

astorm

Frustrated by Magento? Then you’ll love Commerce Bug, the must have debugging extension for anyone using Magento. Whether you’re just starting out or you’re a seasoned pro, Commerce Bug will save you and your team hours everyday. Grab a copy and start working with Magento instead of against it.

No Frills Magento Layout is the only Magento front end book you'll ever need. Get your copy today!

When I first saw PHP: The Right Way floating around my twitter feed, I was a little skeptical. I can’t remember where I first saw the link, but my general memory is its promotion came from the camp of PHP developers who seem to envy the sort of childish drama usually reserved for hacker news rubyists.

Also, the book’s title was clearly an homage one of my favorite programming texts of all time, Javascript: The Good Parts. That book, and the original set of talks it came from changed how I thought about programming, and how I thought about teaching programming. Any book paying (even sly) tribute to this slim volume has a lot of live up to.

I expected PHP: The Right Way to be a polemic — one developer’s opinion on how we should construct our PHP projects, which features to use, and which ones not to. While that approach served Crockford well in Javascript: The Good Parts, it’s not what the PHP community needs.

Fortunately, my preconceptions about the book were completely wrong.

Snapshot

Rather than create a prescriptive pamphlet, Josh Lockhart and Phil Sturgeon, leading a collaborative effort, created what amounts to a snapshot of PHP development for programmers, circa 2014. The next time that ruby intern you hired turns up his nose as your PHP system because he looked at Joomla once in the 6th grade, this is the book you hand him.

PHP: The Right Way outlines everything available to a modern PHP programer. From getting PHP setup on your system, the environments available, modern dependency management with composer, secure coding practices, available language features like anonymous functions, test frameworks, etc, this book is a primer for PHP “done right”. Perfect for the new developer wanting to avoid the sins of the past, and recommended for the experienced developer who may not realize everything the PHP community at large has been up to for the past 10 years.

There’s no particular framework or component composition recommended — the closest PHP: The Right Way comes to being prescriptive is in their description of the concepts of Dependency Injection, Inversion of Control, and Dependency Inversion Principle, but even this section of the book is focused on briefing the PHP developer on what they’ll see out in the world so they can understand what’s happening in modern frameworks. The design patterns are explained in plain english with examples that make the problem these patterns are trying to solve clear.

This is not Gang of Two for PHP.

Wrap Up

Available for free via the web, or via Leanpub (with 100% of Leanpub royalties going to the EFF), there’s no reason not to pickup a copy of this book. Give a copy to your team to set expectations, or find solace in its pages as you plot your escape to a better job. PHP: The Right Way is required reading for anyone planning on making a long term career as a PHP programmer.

Originally published January 31, 2014
Series Navigation<< Getting Started with PHP Composer and MagentoPSR and Code Style Guidelines >>

Copyright © Alan Storm 1975 – 2017 All Rights Reserved

Originally Posted: 31st January 2014