I started dabbling with traits in PHP back when they were under development in 2010. It’s a little surprising then that I’ve just barely come round to actually using them in a project. Seems like PHP 5.3 has been so solid there’s been little need to upgrade, now I’m making the jump from 5.3 straight to 5.5 on a lot of my servers. Anyway, now that I’m rolling out servers with PHP 5.5 traits are on the table. Rather than regurgitating some Hello World example, I’ll illustrate a practial example from my new Softwear codebase and show how traits can save us from carpel tunnel syndrome we contracted before their advent.
Lately I’ve been writing my fair share of BASH, and slowly becoming proficient with it. I wanted to share my version of implementing a common design pattern from the Object Oriented world in BASH. Namely, the template method design pattern.