Using Reflection in Go to assign a Value to a Property of a Struct Contained in a Map

Clock tower reflecting on the water; St. Michaelis, Hamburg, Germany

This solution had me literally working on-again off-again for a full week. One of the main reasons it took so long was I was trying to write a wrapper to simplify because I find the reflect package in Go so unintuitive and hard-to-work-with. But it turns out that trying to write a wrapper around an …

Adding Delegation to PHP

Rube Goldberg Machine

In summary I am proposing the PHP leverage the use statement like the PHP trait does, but with a class modifier to allow for automatic delegation of method calls to contained instances.

Also I am proposing we leverage the disambiguation syntax that is already available for traits, and extend it in a few ways that traits do not address such as:

  1. Use as to allow for renaming from the property names for delegate classes,
  2. Add include or exclude to allow including or excluding specific methods, and
  3. Add use method to allow for including specific methods.

PHP’s Composer is the worst tool, but it is the best we’ve got

Selective focus of person composing on a piano

“Democracy is the worst form of government except for all those other forms that have been tried.” Winston Churchill, plagiarized Composer for PHP is much like democracy, except for there are no others. So I have always hated Composer, for many reasons. And my views on Composer are admittedly in stark contrast with many others …

Practical Object-Oriented Programming for WordPress Developers: A Tutorial Series

Goals of this Tutorial Welcome to this ongoing series whose goal is to teach Object Oriented Programming to WordPress developers. This series will teach you in a unique manner compared to traditional tutorials on OOP and based on my several decades of instructional experience. Using this approach it I believe it will be easier for …

Practical OOP for WordPress Installment 1: Objects

This is the first of an ongoing series whose goal is to teach Object Oriented Programming to WordPress developers.  Check out the table of contents for the list of other installments. This first installment starts off slow and easy to ensure we don’t loose anyone. But fear not, future installments will accelerate the pace and challenge all …