These days, I spend far more time writing and reviewing code in Python than I do PHP. It’s been a refreshing change of pace, and it’s fun to learn the different patterns present in various programming languages. One of the nicer patterns in Python is the Context Manager. It’s a pattern that PHP can learn from and leverage.
Making Singletons Safe in PHP
Last time, I argued in favor of the Singleton pattern in WordPress. Singletons make sense in WordPress specifically for several reasons: They live in the global scope without using the already abused/overused global keyword As a distributed application maintained by several hundred developers, they prevent problems that likely arise from others misusing your code But […]