Re: Terminolgy: the verb corresponding to "toString"



Stefan Ram wrote:
Roedy Green <see_website@xxxxxxxxxxxxxxxxxxxx> writes:
"displays" the width and height in both metric and imperial measure

»o.toString()« "designates", "denotes", "gives", "expresses" a string, or "evaluates to" a string.
(I do not use »returns« here, because an expression does not
»return« its value. »2« does not »return« 2, it designates 2.
I use »return« only when I want to take the point of view of
the /implementation/ of a method. It is the view from /inside/
a method that can use »return«.)

Since Roedy asked about how to describe the toString() method,
"return" seems all right to me. If you're more fastidious, you
might substitute "@return" ;-)

Like you, though, I dislike using "return" for an expression
or sub-expression. The verbs "yield" or "produce" seem better:
"The + operator produces the sum of its operands" or "This expression
yields the smallest prime number greater than x." Even those aren't
always good, though; I'd avoid using either of them to describe the
[] or . operator, for example.

--
Eric.Sosman@xxxxxxx
.