4 ms·
> I want to completely enforce that my record is instantiated with all its invariants dealt with properly Such validation logic can be enforced in the record's
by Floegipoky 4y ago
> I want to completely enforce that my record is instantiated with all its invariants dealt with properly
Such validation logic can be enforced in the record's compact constructor.
- taftster 4y agoYes, agreed. But not in a clean "fluent" style. There's something nice about the fluent style that appeals to me (at least). And I don't like having to provide one constructor for every optional (default) value, when its omitted. There's just not as nice of a style. The "telescoping" constructor pattern is just really hard to use, read and maintain.