Re:What Made OO Be Successful
by sbov on Sunday January 04, 2015 @10:54AM
(#8834727)
I'd be willing to bet that the Point object in any given language is going to have more methods that take it as an argument than methods the class itself has.
[ Parent
| on HN ]
A natural way to separate those two types of methods is:
* methods that do something *to* a Point object
* methods that do something *with* a Point object
The former are better to be declared inside the Point object so that they have access to internal state.The latter shouldn't typically access internal state of the Point object.
This separation can help immensely while analyzing a code base.
True. But I still go looking for the "Point" class first. Then I start looking for things which accept "Point" parameters. Big difference from procedural programming languages.
Re:What Made OO Be Successful
by colanderman on Sunday January 04, 2015 @06:30PM
(#8836345)
In C, I look in "point.h" first, then start looking for other things. Not really different.