Re: Terminolgy: the verb corresponding to "toString"



On Thu, 31 Jul 2008 13:29:51 +0200, Andrea Francia
<andrea.francia@xxxxxxxxxxxxxxxxxxèdatogliereohohoho.it> wrote, quoted
or indirectly quoted someone who said :

The verb is "Returns a string"

It is a little verbose.

You can't use it as a verb in other contexts. e.g.

// convert the co-ordinates to String format for display.

It would be nice to abbreviate that to something like

// format the co-ordinates
// express the co-ordinates
// present the co-ordinates
// exhibit the co-ordinates
// render the co-ordinates
// flatten the co-ordinates

It might be best to pick a fairly obscure word that has no attendant
ambiguous meanings.

Two related problems:

1. What if you have several toString-style methods. e.g.
toISODateSTring toLocalisedDateString. Should those be called
formatISODate or formatAsISODate? I am a stickler for consistency.


2. How do you do the Javadoc to avoid redundancy
and potential inconsistency. e.g.

/** returns date converted to an ISO date String of the form
YYYY-MM-DD in local time.
@param theDate date you want to display.
@return the date converted to an ISO date String of the form
YYYY-MM-DD
*/

--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.



Relevant Pages