Comments
Andreas Raab
andreas.raab at gmx.de
Wed Sep 12 17:09:23 UTC 2007
Blake wrote:
> But, really, how do you apply it in practice to something like the read
> accessors to "numerator" and "denominator" in Fraction?
numerator
"Integer - The number of parts in a fraction (written above
the line of a fraction). See also denominator."
^numerator
denominator
"Integer - The number of parts that make a whole in a fraction
(written below the line of a fraction). Cannot be zero since
nothing can be divided into zero parts. See also numerator."
^denominator
> Some accessors really are both necessary, simple and not needing
> documentation.
Numerator and denominator are no such accessors for sure. First, they
describe pretty complex objects and just because *you* know what these
mean doesn't mean everybody else does. Secondly, the denominator has
even exceptional conditions (like that it can't be zero) which is *most
definitely* in need of commenting. I'm sorry but your example falls far
short of the point you're trying to make.
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|