Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Standards document  RSS feed

 
Gary Ba
Ranch Hand
Posts: 161
Firefox Browser Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
Will someone point me to any Java Coding Standards out there.

Thanks,
John
 
Campbell Ritchie
Marshal
Posts: 56593
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can find two, which are rather different: 1: JavaRanch 2: Sun. I think both have not been updated for a few years. Wherever you work, there will probably be another set of code conventions.
 
Mike Simmons
Ranch Hand
Posts: 3090
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another popular choice is this one:

http://www.ambysoft.com/essays/javaCodingStandards.html

Actually this is really two standards: the free online AmbySoft version, and the version published as The Elements of Java Style. These are similar but different, as the latter came from collaboration with additional coauthors. Both are worth checking out, however.
 
Campbell Ritchie
Marshal
Posts: 56593
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't seen Mike Simmons' link yet, but I am sure it will be different from the other two. No two people can agree about code conventions.
 
Mike Simmons
Ranch Hand
Posts: 3090
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes they can!!!
 
Mike Simmons
Ranch Hand
Posts: 3090
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, wait. Nevermind...
 
Embla Tingeling
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:No two people can agree about code conventions.


That's why you should always give developers a choise. They either comply with the code convention or quit the company.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
uj nossnahoj wrote:
That's why you should always give developers a choise.


Not really. Coding standards or conventions are there for a reason.
Imagine using a third party library or working with someone else's code where the variables are named sObj1, sObj2...and so on, with no comments at all.
I understand standards can vary, but they should be uniform at least across the company. Asking every developer to follow his/her own favorite is just asking for trouble.
 
Gary Ba
Ranch Hand
Posts: 161
Firefox Browser Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell,
Thanks for the link!

John
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right. Maneesh missed out on the joke made by uj nossnahoj, and a nasty discussion followed. That has all been removed, and if you people want to continue that discussion, that's where the Ranch office is for. I will have non of that here anymore.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!