• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

code style conventions

 
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
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • 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: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • 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
 
What do you have to say for yourself? Hmmm? Anything? And you call yourself a tiny ad.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic