[Exceptional C++ Style] Exceptional C++ Style - Item 24: ConstantOptimization

Paul Grenyer paul at paulgrenyer.co.uk
Tue Jan 25 04:54:42 EST 2005


Hi

> Although I would prefer to see "proper" documentation of
> what a function is supposed to do, than have to deduce it from
> the signature.

I wouldn't! Documentation in this context is an extra unnecessary overhead
and isn't necessarily updated when the function is.

A function is a method of encapsulation like any other. I don't care what
happens inside as long as I get the desired result. However, I do care if it
is going to modify the parameters that I pass to it and I can deduce that
from how they are passed. If the function name and parameter names are clear
and well chosen it should also be possible deduce what the modification will
be.

Regards
Paul

Paul Grenyer
email: paul at paulgrenyer.co.uk
web: http://www.paulgrenyer.co.uk
articles: http://www.paulgrenyer.dyndns.org/articles/

"15 miles to the love shack...."




More information about the Effective-cpp mailing list