From: Jim S. <ja...@ne...> - 2005-01-18 20:57:15
|
Roman Rokytskyy wrote: > if (state_lock->lck_physical != LCK_none) { > > if (LCK_convert(tdbb, state_lock, LCK_EX, LCK_NO_WAIT)) > locked = true; > else { > LCK_release(tdbb, state_lock); > ast_flags &= ~NBAK_state_blocking; > backup_state = nbak_state_unknown; > } > } > > I don't understand the reasoning for the wildly unparallel braces. Or why the first "if" has a brace and the second doesn't. Or even the blank line after the brace. The inconsistency of if mean that you have to read each and every "if" to known what the brace 6 lines down means. That defeats the whole idea of code perusal, which is not every line has to be read to follow the flow control. Isn't the unaligned open and close braces a violation of language structure? If the language were defined as statement := if { <statement> } := if { <statement> } else { <statement> } you might have a point. But the language is defined: statement := if <statement> := if <statement> else <statement> The braces, by the definition of the language, constitute a compound statement which, by the definition of paragraphing, should be indented. So your formatting fails the rules of consistency, language definition, and paragraphing. You have made a convincing case that you like this form. Now could you come up with some reasons that anybody else should? -- Jim Starkey Netfrastructure, Inc. 978 526-1376 |