6 ms·
I sometimes feel this also a language or tool problem. For example an integer. In most languages and tools this is a primitive. But most of the time we need a
by pasta 8y ago
I sometimes feel this also a language or tool problem.
For example an integer. In most languages and tools this is a primitive.
But most of the time we need a specific type of integer, for example a positive natural number. You can use a unsigned integer for this but that will include a zero wich we don't want.
So maybe you can use a type/domain object for this in your code, but what about the database field or communication methods?
It all can be done but with a lot of hussle.
I think it would help if we had more primitives that would work in the complete stack.
But then the question is: should ISO 639-2 also be a primitive?
- patates 8y agoAda has subtypes for such cases: https://en.wikibooks.org/wiki/Ada_Programming/Type_System#Constrained_subtype https://en.wikibooks.org/wiki/Ada_Programming/Type_System#Co...
- Uberphallus 8y agoAnd checks on compile time are quite insightful, Ada tends to know beforehand if you're gonna run out of bounds.
- chii 8y agoOr, don't split between primitives vs objects. I think it's a mistake to make thet distinction in many language's design.
- Retra 8y agoThe result of that will not be easy to use objects, but hard to use primitives.