3 ms·
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.
by sbov 12y ago
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.
- oblio 12y agoTrue. 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.
- colanderman 12y agoIn C, I look in "point.h" first, then start looking for other things. Not really different.
- hrjet 12y agoA 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.