News for hackers. Stuff that matters.
Re:Self-obfuscating value objects in PHP by heythere22 on Sunday February 27, 2022 @04:31AM (#30486709)
> This subtle nuance (value equivalency versus object equivalency) can cause problems, particularly if variables are passed by reference to any other functions in your codebase.

Value objects may be great for leveraging the type system to help you write better code by e.g. having only one place for validation. But why should you pass scalar variables by reference? That makes it really hard to reason about what functions and methods do.

There are no comments on this comment yet.