John's answer below quite exactly reflects my own opinion about this.
Best, Oliver On 03.03.22 09:59, [email protected] wrote:
gcc at least (clang too I think) will warn for misleading indentation, so I think forcing braces probably won't add much extra safety. Braces for single lines adds extra visual noise and reduces the code you can see at a glance, so some people argue there's actually a small downside to using them. I believe Chrome's code standard requires the removal of braces on single lines for this reason. (Of course this is a minor bikeshedding issue and it doesn't matter much.) John On Wed, 2 Mar 2022 at 23:39, Albert Astals Cid <[email protected]> wrote:It forces to add a pair of {} to all if/for/while/etc https://gitlab.freedesktop.org/poppler/poppler/-/merge_requests/1091 (it fails in Qt autogenerated files for now, i can fix that if we agree we want it) I can see it being potentially annoying when CI fails because of this but on the other hand it seems it's always safer to include the braces to not fall into the trap of adding a line indented but that it's not really inside the if block What do you'all think? Cheers, Albert
smime.p7s
Description: S/MIME Cryptographic Signature
