Re: Zend Coding Standards and Curly Brackets.
Posted: Thu Apr 12, 2007 12:04 pm
It is the K&R style -- which is probably the most common. http://en.wikipedia.org/wiki/Indent_styleonion2k 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
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.onion2k wrote:I can't think of any good reason not to keep them all the same.
Honestly -- Pick the one you like, but don't say that other styles are less reasonable than your opinion.