The Artima Developer Community
Sponsored Link

toString()

Advertisement

Advertisement

This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

toString()

Posted by Reginald Braithwaite-Lee on 08 Oct 1998, 7:22 AM

> > So the question is, does anybody else out there have an
> > opinion on toString()?

I am in favour of "Lazy Evaluation", also known as "Listener Patern", or even "Demand-Driven Programming".

When I'm doing the coding, I prefer to leave toString() out until I need it, then I add it. Of course, if you're distributing a ompiled class for *others* to use, it would be mannerly to include toString(). But even if others may use your class in the future, if you are including source I don't believe you need to implement toString()automatically.





Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us