From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8f2146b9c1ab93cc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-05 20:07:18 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!hermes.visi.com!newsfeed1.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail From: "Eric G. Miller" Subject: Re: Upping the ante (was): ToString? Newsgroups: comp.lang.ada Message-ID: References: <3C918515.20808@worldnet.att.net> <6e9cd02332705638a4cd86a4a2f521e7.48257@mygate.mailgate.org> <5e081eac7f7a97a4b8c0fa173d366970.48257@mygate.mailgate.org> User-Agent: Pan/0.11.2 (Unix) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Comment-To: "Kent Paul Dolan" Date: Sat, 06 Apr 2002 04:07:15 GMT NNTP-Posting-Host: 216.119.24.215 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1018066035 216.119.24.215 (Fri, 05 Apr 2002 20:07:15 PST) NNTP-Posting-Date: Fri, 05 Apr 2002 20:07:15 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:22172 Date: 2002-04-06T04:07:15+00:00 List-Id: In <5e081eac7f7a97a4b8c0fa173d366970.48257@mygate.mailgate.org>, Kent Paul Dolan wrote: > "Eric G. Miller" wrote: > >> Kent Paul Dolan wrote: > >> > But the java SDK API docs recommend exactly that for every class, you >> > override this behavior inherited from Object, wherever some other >> > toString() implementation makes more sense for your object, which is why >> > I consider this to be an implied contract. If you don't keep the >> > contract, and go with the default, you deserve the results, it seems to >> > me. > >> Implied contracts don't hold up in court. Especially when they only >> make recommendations... > > An interesting, (and cynical) view, but since the first beneficiary of > overriding *.toString() > is always the programmer himself or herself (toString() is an essential > debugging tool), > this isn't quite the same as the instances you cite. Well, if enlightened self interest will motivate java programmers to define a toString() method, that's fine. Basically, the point I was making was, you still won't be able to rely on others always implementing a toString() method. That's the nature of recommendations; they can be ignored. I'm not sure this is even topical in this newgroup.