Things That Matter Most

Things That Matter Most

  • Home
  • Business
  • Faith
  • Technology
  • Politics
  • Creative Writing
  • Email
  • GitHub
  • RSS
  • Twitter

Powered by Genesis

Context Managers in PHP

January 29, 2019 by Eric

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.

Filed Under: PHP, Technology Tagged With: Software Design Patterns

Making Singletons Safe in PHP

January 7, 2013 by Eric

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 […]

Filed Under: Technology Tagged With: Class, Dependency Injection, Duck Typing, Global Variable, Method, Object-oriented Programming, PHP, singleton, Singleton Pattern, Software Design Patterns, Unit Test, WordPress, Y Combinator

About Me

Eric is a storyteller, web developer, and outdoorsman living in the Pacific Northwest. If he's not working with new tech in web development, you can probably find him out running, climbing, or hiking in the woods.

Get the newsletter