News for hackers. Stuff that matters.
Re:Use Your Type System by SideburnsOfDoom on Thursday July 24, 2025 @12:35PM (#44672766)
You're correct that this is far from a new idea.

Relevant terms are "Value object" (1) and avoiding "Primitive obsession" where everything is "stringly typed".

Strongly typed ids should be Value Objects, but not all value objects are ids. e.g. I might have a value object that represents an x-y co-ordinate, as I would expect an object with value (2,3) to be equal to a different object with the same value.

1) https://martinfowler.com/bliki/ValueObject.html

https://en.wikipedia.org/wiki/Value_object

There are no comments on this comment yet.