• Post Reply Bookmark Topic Watch Topic
  • New Topic

Coding standards  RSS feed

 
Sangeetha Raja
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

I wanted to find a coding standard document for Java, servlet, jsp, jsf... programing. Does Sun maintains this document any where in their site? Any one of you please let me know.

Thanks
 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following URL will help you

Java Coding Conventions


sat
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another set of standards here. Note:
  • There are differences from Sun.
  • This second link is much more restrictive about some things.
  • The Sun conventions were last updated about 10 years ago, and there are some things which have gone out of date. There is something where it says "like *** if Java had ***s", but I have forgotten the full details.
  •  
    Jason Irwin
    Ranch Hand
    Posts: 327
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks for the links, our coding in standards are due for an update as well, so I'll put these to good use.

    Although i think that tabs are the only acceptable form of indentation.....

    J.
     
    Alan Hampson
    Ranch Hand
    Posts: 31
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Although i think that tabs are the only acceptable form of indentation.....


    Until someone else's IDE has tabs set to a different width than yours.

    You threw down a gaunlet in one of the many programming religious wars!

    alan
     
    Rob Spoor
    Sheriff
    Posts: 21135
    87
    Chrome Eclipse IDE Java Windows
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Alan Hampson wrote:
    Although i think that tabs are the only acceptable form of indentation.....


    Until someone else's IDE has tabs set to a different width than yours.

    You threw down a gaunlet in one of the many programming religious wars!

    alan

    If you only use tabs then at least the indenting will be consistent. The worst type of indentation is a mix of spaces and tabs. That's why I always tell my tools to convert new tabs to spaces.
     
    Jason Irwin
    Ranch Hand
    Posts: 327
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Rob Prime wrote:
    If you only use tabs then at least the indenting will be consistent. The worst type of indentation is a mix of spaces and tabs. That's why I always tell my tools to convert new tabs to spaces.

    Agreed, mixing is where the mess lies and bad indentation can throw you for a loop at times (well...15 seconds, maybe. If you've not had enough coffee and it's a slow day).

    With tabbing enforced as the only acceptable form of indentation, each developer can set the indentation size to what they prefer and not impose their choice on others. Tab indented code is also smaller (less characters) and thus more efficient to move into/out of source control and push across the network. People who use spaces are simply bloating the text file and killing the planet. Won't they think of the polar bears?

    People who insist on using spaces after being repeatedly told that tabs are the only acceptable form should, of course, be strapped to a bench and flayed until they repent their sins.

    Religious war? Where?

    (In reality I'm not that cut up about it, so long as the team is consistent)
     
    David Newton
    Author
    Rancher
    Posts: 12617
    IntelliJ IDE Ruby
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    That only works in environments that are intelligent enough to have variable-sized tabs when lining up non-tab-aligned lines. It also requires that *every* tool used to view source code (a) have that ability, and (b) be configured for the project's tab size, but only when viewing that project's artifacts.
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!