2 ms·
> You always had to check the individual fields for the zero value. No, you didn't. A required field has a value, period. If it defaults to a particular value,
by teacup50 10y ago
> You always had to check the individual fields for the zero value.
No, you didn't. A required field has a value, period. If it defaults to a particular value, then that's the value it has.
If you had a non-required field, then you marked it 'optional', and checked for the field's existence (or mapped optional fields to a Maybe/Option monad representation, forcing the issue).