3 ms·
Speaking of subjectivity, if (condition) { ... } is the only readable option :-) if (condition) { ... } drowns the code in
by pmontra 10y ago
Speaking of subjectivity,
if (condition) {
...
}
is the only readable option :-)
if (condition)
{
...
}
drowns the code in a sea of (subjective) noise.
There are many other variants https://en.wikipedia.org/wiki/Indent_style#Placement_of_braces https://en.wikipedia.org/wiki/Indent_style#Placement_of_brac... and wars have been fought over them. There are pros and cons for most of them. My tradeoff is the K&R style.
I think editors can automatically convert among styles nowadays. The only thing that matters is consistency.