The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2001



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



Posted by Hiran on November 21, 2001 at 3:55 AM

Thnx Matt for the advice. I just find it so much easier to put it all together if I can. I guess that's what comes from first learning how to program on your own. I also find it hard to decide when an operation that needs to be done in any class should be broken up into multiple methods or kept all in one big method. I usually end up creating one big method, and then realize it's quite big and can be split into multiple methods and do so. Hopefully, my mind will switch sooner than later from creating one big method and then seeing if I could use multiple smaller methods to automatically realising before I code that I can use multiple smaller methods and doing so. O well....

> Well, I was going to keep my mouth shut, but since you've solicited opions, I'll give one: it is poor (if not uncommon) coding style to put so many operations in a single line. It doesn't create more optimized code, it is harder to read(especially for beginners) and it is harder to debug. If you try to keep one operation per line, then the exceptions you get are very helpful and specific. If you separated the contents your while() test into a few lines, your problem would immediately reveal itself.

> - mfg


Sponsored Links

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