comp.lang.ada
 help / color / mirror / Atom feed
From: "Kent Paul Dolan" <xanthian@well.com>
Subject: Upping the ante (was): ToString?
Date: Fri, 15 Mar 2002 04:58:41 +0000 (UTC)
Date: 2002-03-15T04:58:41+00:00	[thread overview]
Message-ID: <d58d629758a615d5bac360da8668b133.48257@mygate.mailgate.org> (raw)
In-Reply-To: a6kv3e$faat1$1@ID-107015.news.dfncis.de

"Nazgul" <darkelf@aim.homelinux.com> wrote in message
news:a6kv3e$faat1$1@ID-107015.news.dfncis.de...

> Is there something like Integer'ToString(xxx) that converts an integer to a
> string ?

More important, is there something like toString(), with the implied
contract that _every_ object will support a parameterless call to it and
do something sensible to return a string representation of the object
usable for debugging, logging, or "not too fancy" data presentation?

To a newbie(*) Java programmer (me) this is one of the more delightful
discoveries about the language.

xanthian.

As an old timer computer language junkie, it is one of the more
delightful discoveries about _any_ language that it supports features
that are usable anywhere and always do what you want without you having
to think very hard about them.  "Good programmers are lazy programmers"
does not usefully imply that "lazy programmers are good programmers" but
the trend is sure in that direction.

*[See http://www.well.com/user/xanthian/java/TravellerDoc.html for
"pretty much everything I know about Java so far. plus a lot I swiped
without understanding it very well", in source code form.  You might
find something worth stealing.]

And actually, it is harder to spell what was requested in Java,
something like

  String result = ( new Integer( someIntValue ) ).toString();

since "Integer"s are first class objects, but "int"s, the usual
counting numbers, are not, one of Java's multitude of
maddening flaws.

[Don't get me started.]


-- 
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG



  parent reply	other threads:[~2002-03-15  4:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-12 13:16 ToString? Nazgul
2002-03-12 13:24 ` ToString? Peter Hermann
2002-03-12 13:25 ` ToString? Ingo Marks
2002-03-12 13:27 ` ToString? Larry Hazel
2002-03-12 13:30 ` ToString? Martin Dowie
2002-03-12 16:48   ` ToString? Jeffrey Carter
2002-03-13  8:38     ` ToString? Martin Dowie
2002-03-13 22:18       ` ToString? Jeffrey Carter
2002-03-14  0:36         ` ToString? Adrian Knoth
2002-03-15  4:58 ` Kent Paul Dolan [this message]
2002-03-15  5:22   ` Upping the ante (was): ToString? Jim Rogers
2002-04-04 23:21     ` Kent Paul Dolan
2002-04-05  5:09       ` Eric G. Miller
2002-04-05 19:45         ` Kent Paul Dolan
2002-04-06  4:07           ` Eric G. Miller
2002-04-06 22:23             ` Implied Programming contracts: " Kent Paul Dolan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox