3 ms·
> Again, asked another way, is it ever a problem to create a "small type" if it follows that rule? IMO the biggest problem isn't having too many distinct types
by Terr_ 13y ago
> Again, asked another way, is it ever a problem to create a "small type" if it follows that rule?
IMO the biggest problem isn't having too many distinct types, because they represent information you'd need to track manually anyway, like knowing that $time is seconds rather than milliseconds. I'd be more worried about:
1. The risk of conflicts between different groups of people who both defined their own type called called "Newtons" and want their libraries to work together.
2. The sliding-scale of inconvenience if your implementation gets in the way of the mathematics, like having to call `foo.asFloat() * 2` rather than `foo * 2`. (You can relax things a bit by relying on best-effort annotations.)
- iaskwhy 13y agoThank you for your insights, it's always great to learn new things :)