Zend Coding Standards and Curly Brackets.

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Zend Coding Standards and Curly Brackets.

Post 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.
(#10850)
Post Reply