2 ms·
Objects are records with a controlled interface, so that you don't have to see the internal details. This allows restructuring of the internals without disrupt
by mikewarot 5y ago
Objects are records with a controlled interface, so that you don't have to see the internal details. This allows restructuring of the internals without disrupting the code that uses the objects. It is a fairly well understood mechanism for preventing unwanted side effects.
The interface is type checked, and the appropriate way set the type rules is to bundle them with the interface (and thus the object), not with the user code.