File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Style Guide

 
Stef Widmer
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
Since now I've used the array declaration form of:
Also in most Java books I've seen the follwing signature for the main methode :
.
But now I found the follwing in Suns Java Coding Style Guide from Achut Reddy:


What notation are you using? Is this realy an issue?
Thanks for all response.
Cheers
Stef

[ July 13, 2004: Message edited by: Stef Widmer ]

[ July 13, 2004: Message edited by: Stef Widmer ]
[ July 13, 2004: Message edited by: Stef Widmer ]
 
Jan Rotthaus
Ranch Hand
Posts: 56
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stef,

In Sun's Code Conventions for the Java Programming Language I don't find anything on the declaration of arrays. In my opinion you should always have a Style Guide and for the certification assignment I would adhere to Sun's Style Guide. As far as your declaration question is concerned: The most important thing is, that your array declarations are consistent (I personally prefer to ).

Just my $0.02,

Jan
 
Weerawit Maneepongsawat
Ranch Hand
Posts: 203
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://java.sun.com/docs/codeconv/html/CodeConventions.doc10.html#182

See in example...



hope that help.
[ July 13, 2004: Message edited by: Weerawit Maneepongsawat ]
 
Jon Entwistle
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I understood the convention to be placing the brackets after the type for readability issues - e.g. int myMethod()[] is a lot more difficult to read than int[] myMethod.

As far as I know, allowing the brackets after the variable is really a concession for those migrating from C.

Regards,

Jon
 
Stef Widmer
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
the PDF I've found comes from SUN's site, here's the URL: Java Coding Style Guide
. You'll find the array declaration in section "8.1.3 Array declarations".
Perhabs it's an out dated version. But why'is it than still on Sun's site?
However, it's maybe not worth spending to much time on this issue...

Cheers
Stef
[ July 13, 2004: Message edited by: Stef Widmer ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic