• 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

code style conventions

 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic