9 ms·
> Classes aren't a great abstraction when enforcing program invariants like "this object must at least have fields a and b." Can you elaborate on the functiona
by b3morales 4y ago
> Classes aren't a great abstraction when enforcing program invariants like "this object must at least have fields a and b."
Can you elaborate on the functional difference between
- an enhanced dictionary where certain keys are guaranteed as part of the type, and
- a record type (class, struct, whatever) with named fields?