Liste des Groupes | Revenir à cl c |
One reason to "overuse" braces is that you can easily add anotherAdding braces in this situation is _incomparably_ easier than splitting an annoying single-line `if` statement into multiple lines, discovered during an interactive debugging session. Which is something you yourself described as "easy enough" below.
statement. If you write:
if (failed)
WARN("failed because...");
else
ok++;
and later decide you need two statements in the else clause, you then
need to add braces. If they're already there, you don't.
What you call "Egyptian" braces is the style used by the creators of theFirstly, this is style. Being a "creator of the language" does not make one an authority on code formatting style.
language
and in a *lot* of open source software. Even if you don't likeCertainly. It is not a good practice to force your own style onto someone else's code or an already existing code. Still, in most reasonably organized professional development environments personal preferences are normally welcomed with certain granularity. It is usually organized on "per translation unit" basis.
the style, you'll need to deal with it.
I have my own fairly strong preferences about brace placement, but the
most important rule is to follow the conventions of the code I'm working
on.
Les messages affichés proviennent d'usenet.