aspose file tools*
The moose likes Cattle Drive and the fly likes Uniform Java Styles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Uniform Java Styles" Watch "Uniform Java Styles" New topic
Author

Uniform Java Styles

Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
If there is one area of programming where uniformity is an unmitigated virtue, it is typographic coding style. It allows a programmer to work with code written at another time and place without being slowed down or confused by stylistic differences.

Sun has posted an official Java style guide here:
http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html

JavaRanch has posted an "alternative" Java style guide here:
http://www.javaranch.com/style.jsp

This version differs in significant areas, such as never putting constants in all caps and usually surrounding identifier names with blanks.

Since Sun has an extensive public input process and is particularly open to leaders in the field like the brass at JavaRanch, what is the point of turning out a bunch of programmers schooled in a different coding style who will join thousands of colleagues who follow Sun's official style? If you think the style can be improved, why not propose a change for everyone?


Mike Gershman
SCJP 1.4, SCWCD in process
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
... what is the point of turning out a bunch of programmers schooled in a different coding style who will join thousands of colleagues who follow Sun's official style?


Somehow I suspect that there's a few more style guides out there than just those two.

In terms of the Cattle Drive, an important part is learning to conform to a style guide of *any* kind. This discussion has a couple comments on that - you might want to check out Paul's post in there.
[ May 30, 2005: Message edited by: Pauline McNamara ]
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9047
    
  10
Originally posted by Mike Gershman:
Since Sun ... is particularly open to leaders in the field like the brass at JavaRanch, ...


I'm not as sure of this as you seem to be.

... what is the point of turning out a bunch of programmers schooled in a different coding style who will join thousands of colleagues who follow Sun's official style?

As Pauline pointed out, the idea is to teach programmers that they need to be flexible and conform to the style guide that is in place where they are employed, whether or not it is the same as the one they are used to. If they work at a place where the Sun Style Guide is the official style guide for that company, they should conform to that style guide. If not, then ..., well, you get the idea.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Uniform Java Styles