Questions tagged [code-formatting]
focuses on legibility and consistent look of code: lexical-level intelligibility is a basic element of coding-style
6 questions
97
votes
17
answers
22k
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 ...
329
votes
36
answers
397k
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())
{
...
31
votes
29
answers
100k
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 ...
18
votes
6
answers
13k
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 , ...
27
votes
5
answers
2k
views
Formatting code a bad thing when using a VCS?
I almost always format my code before I commit to make sure it's done properly. Most of my team don't really care and don't always format their code properly (minor things that don't affect the code ...
3
votes
1
answer
477
views
Workflow for git / code formatting / commit hooks etc
Our team is growing, and with it, discontent with common coding standards being imposed on developers with alternate (strong, bordering on religious) views on what constitutes a good coding style.
...