Skip to main content

All Questions

47 votes
9 answers
61k views

Line break before or after binary operator? [closed]

While Sun's Java code convention suggests to put line break before the operator, many other guidelines disagree with it. I do not see any obvious pros and cons. Are there advantages of using one of ...
Nutel's user avatar
  • 1,511
12 votes
5 answers
2k views

How to introduce new language features in a legacy source code?

I have a coding style related question. In my example it is java, but I think this can be a generic question regarding languages that are changing rapidly. I'm working on a java code base which was ...
melonT's user avatar
  • 243
8 votes
2 answers
1k views

Is it a good practice to create new variable to see the output of a function?

Consider these 2 types of implementation: public int add(int x, int y) { return mysteriousAdd(x, y); } public int add(int x, int y) { int output = mysteriousAdd(x, y); return output; } A ...
kai's user avatar
  • 245