3 ms·
Rule 59 from the Joint Strike Fighter C++ coding guide[1] calls out exactly this bug (with example bad code similar to Apple's bug): all if/while/for bodies mus
by jzwinck 13y ago
Rule 59 from the Joint Strike Fighter C++ coding guide[1] calls out exactly this bug (with example bad code similar to Apple's bug): all if/while/for bodies must be enclosed in braces. Some other notable guides, like those frmo Google and NASA, do not require this. I thought it was a good idea before, and very good idea now.
[1]: http://www.stroustrup.com/JSF-AV-rules.pdf http://www.stroustrup.com/JSF-AV-rules.pdf
- beagle3 13y agoIt's a useless rule unless you have a tool that enforces it - because it is easy to violate without noticing. If you have a style checker that enforces, then this rule is acceptably useful. However, if you already have a checker as such, why not have it check indentation (and multiple statements per conditional statement), and catch a larger class of bugs? Personally, I think Google/NASA is right, and JSF is wrong.