Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

coding standard in java project

 
priyanaka jaiswal
Ranch Hand
Posts: 79
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


what coding standard we need to follow while developing application?


Thanks in advance
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12020
25
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Matthew Brown
Bartender
Posts: 4549
8
Java Netbeans IDE Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 79
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you for quick response
 
Campbell Ritchie
Sheriff
Pie
Posts: 47258
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest you to follow Java Good Pratices
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic