File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sun coding convention question

 
Jim Petersson
Ranch Hand
Posts: 48
  • 0
  • 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: 2271
3
Eclipse IDE Java Spring
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic