3 ms·
> The core concept of most OO designs is that data is coupled with the methods that operate on that data. I've read this a lot, in this discussion and elsewher
by tome 9y ago
> The core concept of most OO designs is that data is coupled with the methods that operate on that data.
I've read this a lot, in this discussion and elsewhere, for years. But what does it mean? Does it mean data is syntactically coupled with state? Otherwise I don't get why pretty much any C program is an OO design by this definition.
- skrebbel 9y agoMany C programs are OO by this particular definition :) I take the least ambitious definition of OO on purpose, because that definition is often the one that matters the most. I mean message passing yada yada, if you look at most OO software out in the wild, the key feature is the syntactical coupling between nouns and the verbs that operate on those nouns. Extra bonus though, compared to eg C, is that in OO languages you don't need to spell out the type (plus polymorphism ofc). So String_trim(&myString) becomes myString->trim() and that's shorter and, most of the time, equally clear and less noisy. I miss this most when coding Elixir.