4 ms·
I have done that in Go and Typescript ("branded types"), it's actually very useful to discriminate ids. It prevents stupid mistakes that are actually hard to sp
by Seb-C 3y ago
I have done that in Go and Typescript ("branded types"), it's actually very useful to discriminate ids. It prevents stupid mistakes that are actually hard to spot. Making it a whole class is maybe going too far however, as the costs may outweight the benefits.
- esafak 3y agonim has distinct types, kotlin has inline classes, scala has type aliases. It is a good feature.