From: <bo...@el...> - 2002-02-14 16:19:38
|
I'm new to the developer list, and have a question about the "PEAR standards" I looked at the link and noticed to my dismay that the PEAR standards call for StudlyCaps in function names.. This is very strange since php itself uses lowercase names separated by undercores. In the eighties, I was part of a Software Engineering methods team at Control Data. We were working on next generation operating systems. Our experience at that time led us to conclude that any standard that did not make coding and maintenance easier was detrimental to productivity. At that time, as today, we had code to work with that was old, and followed different standards. Fashions change, but there are and always have been people who want to impose their own preferences on others. "Standards" groups seem to attract these people. We concluded that the coding standards should be limited to rules which made it easy to remember the names and understand the functions. For instance, one rule was - no misspellings in function names. It might be attractive to use the name mv_to_outpt cuz its shorter than move_to_output() , but then you and everyone in the future needs to remember how you hacked down the words. In the many projects I have been involved in since then, coding standards were followed ONLY if they were simple and limited to essential features. Complex and detailed standards are generally ignored, especially by the most valuable programmers. Project managers are not going to risk missing schedule by trying to get skilled and experienced programmers to follow certain capitalization rules, for instance. Productive programmers are too busy to come to standards meetings, so rules would often be designed out of ignorance. A few years ago, I was consulting in a company that released standards saying the Oracle table names had to end in "_TBL" and views had to end in "_VW", a useless appendage that defeated the concept of tables and views. PEAR also says: "Use an indent of 4 spaces, with no tabs. ". I use spaces myself, but four is too many, and tends to push your lines too far to the right, and sometimes leads to ugly wrapping. Two spaces is enough to show the logic. Even one space works visually. The point to my question is, does the phpws team really mean to impose low level control over how contributors do their coding? Isn't it enough to say that coding style must be clean, readable, logicallly organized and consistent? What difference does it make if one coder uses StudlyCaps and another doesn't? On 13 Feb 2002 at 20:30, Karsten Dambekalns wrote: > In the article describing the new core are some examples exhibiting > the php_short_open tag. Since this is "forbidden" by the PEAR coding > standard (which we adopted for phpWS) that should be changed to > <?php. Just nitpicking :-) > > And the link to the PEAR coding standard on the coding standards page is > broken. It now lies under: > http://pear.php.net/manual/en/standards.php > |