File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes coding standards Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "coding standards" Watch "coding standards" New topic

coding standards

feroz muhamed
Ranch Hand

Joined: Nov 15, 2003
Posts: 87
Please give me the coding standards for a good java project.
chi Lin
Ranch Hand

Joined: Aug 24, 2001
Posts: 348
Coding style guide used
on Cattle Drive.
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
The most important coding standard is always the one favoured by whoever will be paying you for the code.
People have plenty of differing opinions about the details of coding standards, and arguments can get quite heated. The bestthing is to learn to be flexible and adopt whatever coding standard is preferred for a particular project.
That said, the Cattle Drive coding standard mentioned above is as good as any, and making sure your own "learning" code follows that standard is a good way to learn to follow standards generally.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
We found that the aura of authority given by having a real book helped. I bought Scott Ambler's Elements of Java Style for everybody on the team, and published a very short list of exceptions.
If your team all uses the same IDE, get as much of your style into the code formatter as possible. I use the formatters in Eclipse and Visual Age often. It's nice to type or refactor at maximum speed without worrying about indentation and alignment.
Finally, if you want to go all the way on this, look into an automated style checker. JTest is one example. I find them way too finicky about unimportant things, but it might be just the thing to bring a team into line.
[ January 01, 2004: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Anurag Mishra
Ranch Hand

Joined: Jun 16, 2003
Posts: 121
Hi All,
I am replying late but I have gonbe through a very good of Java coding standard its
Elements Of Java Style
Al Vermeulen
And we need to follow standard anywhere whereever we are going to write codes even its just for testing.

SCJP 1.2
Chris Harris
Ranch Hand

Joined: Sep 21, 2003
Posts: 231
You may want to look atjalopy and checkstyle. There are tools that I use both at work and at home.
Hope they help.

I agree. Here's the link:
subject: coding standards
It's not a secret anymore!