Page 2 of 2

Re: Zend Coding Standards and Curly Brackets.

Posted: Thu Apr 12, 2007 12:04 pm
by Christopher
onion2k wrote:Maybe someone here can figure this out. Why do Zend specify that classes and functions should have the opening brace on a seperate line, and if blocks and switch case blocks have the brace on the same line? Eg
It is the K&R style -- which is probably the most common. http://en.wikipedia.org/wiki/Indent_style
onion2k wrote:I can't think of any good reason not to keep them all the same.
That's the essence of all of these arguments. Nether side can see "any good reason" for the other side's arguments. K&R distinguishes function blocks from statement blocks -- obviously they thought they were conceptually different. Allman style does not distinguish -- obviously the thought consistency was more important. The difference are ultimately trivial.

Honestly -- Pick the one you like, but don't say that other styles are less reasonable than your opinion.