• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
I am not a spy. Definitely. Definitely not a spy. Not me. No way. But this tiny ad ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic