2 ms·
First off, thank you for the informative and balanced response. Second, I agree with your reasoning chain, but I don't subscribe to the initial idea: accessors
by dexen 16y ago
First off, thank you for the informative and balanced response.
Second, I agree with your reasoning chain, but I don't subscribe to the initial idea: accessors being about future-proofing. To me sprinkling accessors all around is more about focusing on the (safer, easier) `known unknowns' and satisfying kLOC metrics. And the assumption of being able to freely exchange code underneath as long as the objects stay the same.
So no, I haven't missed the whole accessor/mutator business -- I consider them special cases, to be used sparingly. And as such, I see no point in optimizing for them.
To keep it short, lemme commit the Argument to Authority fallacy here: http://c2.com/cgi/wiki?YouArentGonnaNeedIt http://c2.com/cgi/wiki?YouArentGonnaNeedIt http://c2.com/cgi/wiki?AccessorsAreEvil http://c2.com/cgi/wiki?AccessorsAreEvil and http://c2.com/cgi/wiki?LawOfDemeter http://c2.com/cgi/wiki?LawOfDemeter
But then again, perhaps one day I'll learn better, remember your remarks and start making better use of accessors :)