开发者

Why is the PHP Zend Framework coding style inconsistent with respect to brace alignment?

开发者 https://www.devze.com 2023-02-20 14:44 出处:网络
In the PHP Zend Framework coding style: http://framework.zend.com/manual/en/coding-standard.coding-style.html

In the PHP Zend Framework coding style:

http://framework.zend.com/manual/en/coding-standard.coding-style.html

The style for classes and functions is like the Microsoft style - brace aligned, while the style for control statements such as if and switch is K&R - brace offset.

Can anyone offer a rationale for why the two distinct styles ar开发者_如何学编程e used within the same standard?


Matthew Weier O'Phinney answers it best at: http://zend-framework-community.634137.n4.nabble.com/ZF-Coding-Guidelines-td656845.html

In large part, our standards are adopted from PEAR coding standards (which in turn were adopted from Horde CS); our goal is to have standards that are interchangeable with other projects, to ensure code consistency and readability. PEAR standards are widely adopted (ADODb, Solar, Phing, and others all use PEAR CS), and are a logical choice.

If you want to know why 1TB is used as it is, I suggest looking at the list archives for the PEAR and Horde projects.

Discussion of the coding standards: http://zend-framework-community.634137.n4.nabble.com/Coding-Standards-amp-ZF-0-2-td638409.html

0

精彩评论

暂无评论...
验证码 换一张
取 消