by thrmsforbfast · 8y ago · 0 comments
This is particularly true of software, but I'd argue it's also true of basically every branch of mathematics outside of a few particular sub-fields of algebra (which are either extremely simple or extremely abstract, and often both).
> ADTs don't hide mutable state. That much is something OO has a special claim to.
How so? Abstract datatypes certainly hide mutable state. Just because a language doesn't have the "private" keyword doesn't mean that internal data can't be excluded from the interface... this was done all the time in e.g. C without the message passing semantics that characterize OO languages.
Maybe if you can mutate it, but having it be visible isn't an issue.
> Abstract datatypes certainly hide mutable state.
ADTs are normally understood to be values i.e. immutable. Hidden structure is not the same thing as hidden state.