Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

code style conventions

 
Andy Jung
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

1. where is it best to place inner classes? At the beginning of a class where member variable declarations are placed or at the end?
2. How to wrap a code-line with "=" - Operator? The sun code style conventions says, if an operator has two operands, like +, -, * or /
then it should be done this way for example:

Since in mathematics "=" is also defined as an operator with two operands it would be like this?:



Looks strange, doesn't it?

Kind REgards,
Andy
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andy,

1/ My inner classes are at the end of a class
2/ I just used 80 chars per line (so your dummy-example is on 1 line in my code)

Kind regards,
Roel
 
Andy Jung
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel De Nijs wrote:Hi Andy,
2/ I just used 80 chars per line (so your dummy-example is on 1 line in my code)


Hi Roel,

ok, 2) was a bad example , I also use 80 chars per line,
but how do you break lines regarding those operators, if we assume a need of a line break?

Kind regards,
Andy
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andy,

I don't do something special: just format with 80 chars per line and that's it. Eclipse takes care of the rest

Kind regards,
Roel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic