4 ms·
The second example does lack braces in two nested 'if' statements. Did you ignore that? Granted it is not three levels deep and granted there is a brace in the
by foo101 8y ago
The second example does lack braces in two nested 'if' statements. Did you ignore that? Granted it is not three levels deep and granted there is a brace in the 'else' part but that's no reason to ignore the fact that K&R does in fact omit the braces for nested 'if-else' statements.
Demanding now that the nesting has to be less than three levels deep to omit braces is just moving the goalposts.
- tom_mellior 8y ago> nested 'if-else' statements Yeah, "else if" is a special case where I wouldn't put braces even if I prefer them everywhere else. > Demanding now that the nesting has to be less than three levels deep I specifically asked for a three levels before, in https://news.ycombinator.com/item?id=19162933 https://news.ycombinator.com/item?id=19162933, not "now".
- foo101 8y agoYour original critique from https://news.ycombinator.com/item?id=19161365 https://news.ycombinator.com/item?id=19161365 said this: > Yes, C doesn't force you to use braces here, but this is really overdoing it. It said nothing about nesting level depth. The question of nesting level appeared later in a child comment of yours which I believe is moving the goalposts. Sorry, I didn't make this clear in my previous comment. Having said that, I do agree with you that braces are helpful. But then, we should all decide the pants policy in our own homes: https://groups.google.com/d/msg/nodejs/MWaivVTirPY/0pnRjKsggkIJ https://groups.google.com/d/msg/nodejs/MWaivVTirPY/0pnRjKsgg...