File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes coding standard in java project Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "coding standard in java project" Watch "coding standard in java project" New topic
Author

coding standard in java project

priyanaka jaiswal
Ranch Hand

Joined: Jun 03, 2011
Posts: 79
Hi,


what coding standard we need to follow while developing application?


Thanks in advance
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11311
    
  16

if you are coding by yourself, for yourself, you can use any standard you want - but make sure you DO use one.

If you are working for a company or in a group, you should use whatever standard the group/company tells you to use.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4387
    
    8

That depends. If you're working for an organisation that has a coding standard, or you're forced to use one for some other reason, use that one.

If you're choosing to follow a coding standard, then it's entirely up to you. If you Google you'll find plenty (e.g. http://www.oracle.com/technetwork/java/codeconv-138413.html, https://code.google.com/p/java-coding-standards/), and you just need to choose one you like.
priyanaka jaiswal
Ranch Hand

Joined: Jun 03, 2011
Posts: 79
thank you for quick response
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38793
    
  23
We have our own, but a lot of people myself included think things like “avoid do loops” are unnecessarily strict. The few style guides I have seen seem to be several years old.
Rafael Prado Oliveira
Greenhorn

Joined: Apr 30, 2013
Posts: 28
I suggest you to follow Java Good Pratices
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14146
    
  18

I think that most developers follow the standards that Sun invented long ago: CamelCase for class and interface names, lowerCamelCase for methods and variables, etc. - see the document Code Conventions for the Java Programming Language, which is and old document (1999) but which still has some relevance.

A book which is not just about coding standards but also about good Java programming practice is Effective Java - every Java developer should read this book.

Consider using tools such as Checkstyle, PMD and FindBugs, which will check for style and many common programming problems in Java programs.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: coding standard in java project