• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Java Style Guide

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic