This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Sun coding convention question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Sun coding convention question" Watch "Sun coding convention question" New topic
Author

Sun coding convention question

Jim Petersson
Ranch Hand

Joined: May 28, 2008
Posts: 48
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 ]

SCJP 5<br />SCJD
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2266
    
    3

Does this violate suns coding convention?


Yes, totally

Take a look here, man: http://java.sun.com/docs/codeconv/


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Jim Petersson
Ranch Hand

Joined: May 28, 2008
Posts: 48
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 ]
Joshua Fix
Ranch Hand

Joined: Sep 18, 2007
Posts: 57
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 <>.


SCJP 5.0
Jim Petersson
Ranch Hand

Joined: May 28, 2008
Posts: 48
Hmm, yes that's right. It didn't realize that it were dealing with generics.
 
Don't get me started about those stupid light bulbs.
 
subject: Sun coding convention question