aspose file tools*
The moose likes Cattle Drive and the fly likes Formatting - Spacing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Formatting - Spacing" Watch "Formatting - Spacing" New topic
Author

Formatting - Spacing

Sean Webster
Greenhorn

Joined: Aug 24, 2002
Posts: 21
Can anyone tell me the proper spacing rules.
In the assignment tutorial, I see:
System.out.println( "Spot is now home" );
}
***Notice the space after the println method parentheses and the string
In the style guide, I see:
System.out.println("Oatmeal is good and good for you");
***notice the no spacing between the parentheses and the string. Which is correct, or does it even matter?
This is my understanding of the spacing rule:
1 - all identifiers are surrounded with whitespace unless it reduced clarity
2 -note the exceptions in the style guide (methods, arrays, pre and post increment, and casting)
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
I'm whispering so only you will hear this...
There would appear to be a couple of inconsistencies regarding the style guide and what is actually expected. Mostly to do with some spacings not addressed in the style guide.
A rule that should get you by: If you were to surround all of your String literals with spaces, you would not be in error.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Formatting - Spacing