I’ve been learning a bit about Haskell recently and it has me pining for lazy evaluation in PHP without all the effort of doing it manually. As I envision it lazy evaluation in PHP would allow annotating a class property or even a variable with a typehint-like keyword lazy and then when that property or …
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:
asto allow for renaming from the property names for delegate classes,
excludeto allow including or excluding specific methods, and
use methodto allow for including specific methods.
“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 …
Yes, complex conditionals are worse. But there is a third, better way. And no, it does not involve GOTOs. Me This post is about a coding pattern I have never seen used by anyone else for writing guard clauses, especially when those guard clauses are complex. This pattern results in code that is significantly more …
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 …
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 …