The tag has no wiki summary.

learn more… | top users | synonyms

84
votes
37answers
44k views

Should curly braces appear on their own line? [closed]

Should curly braces be on their own line or not? What do you think about it? if (you.hasAnswer()) { you.postAnswer(); } else { you.doSomething(); } or should it be if (you.hasAnswer()) { ...
9
votes
7answers
3k views

Code formatting SQL queries

Should I break SQL queries in different lines? For example in the project I am working on, we have a query that is taking 1600 columns! 1600 + tab chars. I wrote queries like this: "SELECT bla , ...
30
votes
29answers
11k views

How do you use blank lines in your code?

There has been a few remarks about white space already in discussion about curly braces placements. I myself tend to sprinkle my code with blank lines in an attempt to segregate things that go ...
27
votes
30answers
5k views

Is it common to print out code on paper? [closed]

I like to keep my lines of code under 80 characters because: I don't have to do any horizontal scrolling; I know the line is probably too complicated if it exceeds this limit; and it prints out ...
64
votes
17answers
6k views

Is imposing the same code format for all developers a good idea?

We are considering to impose a single standard code format in our project (auto format with save actions in Eclipse). The reason is that currently there is a big difference in the code formats used by ...