Hey everybody,
in today's leadership meeting, the question was brought up if we want to normalize the coding style in coreboot to _always_ use braces in if, else and for statements, even if it's just one statement they're wrapping.
The arguments made in favor were:
1. it's more consistent
2. it's safer: you won't accidentally add a statement that is outside the context it's supposed to run in (or even move a statement out into the parent context by inserting another statement)
So instead of:
if (foo)
bar();
else {
baz();
quux();
}
we'd do:
if (foo) {
bar();
} else {
baz();
quux();
}
The attendees were generally in favor, but wanted to ask the wider community. The idea of putting it up for a vote was brought up, but we decided to discuss it first (and vote if there's disagreement, after the arguments were exchanged. makes for a clearer ballot, too)
Patrick
--
Google Germany GmbH, ABC-Str. 19, 20354 Hamburg
Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado