Mandatory use of braces

前端 未结 21 2356
旧时难觅i
旧时难觅i 2021-02-12 23:26

As part of a code standards document I wrote awhile back, I enforce \"you must always use braces for loops and/or conditional code blocks, even (especially) if they\'re only one

21条回答
  •  醉话见心
    2021-02-13 00:12

    I prefer adding braces to single-line conditionals for maintainability, but I can see how doing it without braces looks cleaner. It doesn't bother me, but some people could be turned off by the extra visual noise.

    I can't offer a better counterargument either. Sorry! ;)

提交回复
热议问题