• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Sun coding convention question

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I usually make the name of my member variables start with m_
Such as int m_myInt;
And static members with s_
As: static int s_myInt;

Does this violate suns coding convention?

Thanks,
Jim
[ July 10, 2008: Message edited by: Jim Petersson ]
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Does this violate suns coding convention?



Yes, totally

Take a look here, man: http://java.sun.com/docs/codeconv/
 
Jim Petersson
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Crap, I was afraid of that
What about generics. When running checkstyle on my code it warns me that there are no whitespace following/preceeding '<' and '>'

Example:
List<Integer> myList; -> generates a warning

List < Integer > myList; -> ok according to checkStyle

For me those extra spaces looks a bit awkard, and I can't find anything about generics in suns coding convention either.
[ July 10, 2008: Message edited by: Jim Petersson ]
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It sounds to me like it's interpreting them as operators and not as enclosing braces for generics. I've never seen a generic type have spaces before or after <>.
 
Jim Petersson
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm, yes that's right. It didn't realize that it were dealing with generics.
 
reply
    Bookmark Topic Watch Topic
  • New Topic