4 ms·
> IMO, better would be a coding convention to skip curly braces but if and only if... IMHO, even better and simpler would be a coding convention to not skip c
by SideburnsOfDoom 13y ago
> IMO, better would be a coding convention to skip curly braces but if and only if...
IMHO, even better and simpler would be a coding convention to not skip curly braces. The end.
(as per last time this was raised: https://news.ycombinator.com/item?id=7283767 https://news.ycombinator.com/item?id=7283767 )
Otherwise, the OP is right on the money; there are multiple levels that would have caught this bug - a layout convention, a linter, a code review, pairing, a unit test, an integration test. Or just a refactor of the big old method for clarity.
- vkjv 13y agoThis. In addition, a linter would have caught his example with braces because of the improper indent. And, IMHO, without that indent it becomes glaringly obvious.
- SideburnsOfDoom 13y ago> This. In addition, a linter would have caught his example with braces because of the improper indent That and the dead code after it.