4 ms·
Once you start thinking that way, you start wondering why Objects, rather than (from Java) records, or (from most every other language) structs/tuples. That is
by lostcolony 4y ago
Once you start thinking that way, you start wondering why Objects, rather than (from Java) records, or (from most every other language) structs/tuples.
That is, why bundle functions with the data and encapsulate it as a new type that ties them together? It invites the very thing you're saying not to do; if you want to think of it as just data...then make it just data. Nouns only; no verbs. Even if you have a verb as data, treat it as a noun (i.e., a higher order function).
It's all translatable; you can break an object into functions and data, and create an object bundling functions and data, but, as you say, it's about how you think...and objects do not encourage you to think about the underlying data, but about the abstraction. And abstractions are leaky, don't translate well into new domains, and are much harder to communicate (both at an API level and between humans) than data.