5 ms·
an age is a nonnegative duration where one endpoint is constrained to be a birthday. even birthday could be abstracted. couldn't a bottle of wine have an age?
by nh23423fefe 3y ago
an age is a nonnegative duration where one endpoint is constrained to be a birthday. even birthday could be abstracted. couldn't a bottle of wine have an age?
this enables the query you care about ageof(person, onday)
i like to think about types, not as isomorphic to some tuple but as the package of methods they support
interfaces are more important than classes, is the pithy exposition
- klysm 3y agoI agree with thinking of exposing an interface, but all data must fit into bytes at some point. It’s best to make it impossible to make it impossible to fuck that up, and also add an interface on top to make it even harder.
- awwsmm 3y ago"Programming to an interface" is another great topic for a blog post. But yes, you're correct that there are many different ways to model this. Which one is best for your particular use case depends on the details of the problem you're trying to solve.