The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2001

Advertisement

Advertisement

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.

Message:

Style

Posted by Matt Gerrans on November 21, 2001 at 4:03 PM


> i was reading an article i printed out :p
> check this out Java Programming Style Guide

Of couse, keep in mind that they are only guidelines, not rules, and on some points they have made some dreadful mistakes in judgement; in particular, they encourage poor placement curly braces (based simply on historical precedent). They suggest this difficult-to-read and ugly style:


class BadStyle {
void method() {
for( blah ) {
while( blah ) {
...
}
}
}
}

(a throwback to the C programming days, when cryptic code was valued, because people believed if others could not understand what they wrote, the must surely be more clever than those others) instead of this easy-to-grok and aesthetically pleasing style:

class GoodStyle
{
void method()
{
for( blah )
{
while( blah )
{
...
}
}
}
}

...not that I have any biases on the matter. This is just my completely objective assessment of the situation, of course. ;-)

- mfg



Replies:

Sponsored Links



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