Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Sun coding convention question

 
Jim Petersson
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • 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 ]
 
Roberto Perillo
Bartender
Posts: 2273
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
Joshua Fix
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Hmm, yes that's right. It didn't realize that it were dealing with generics.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!