Re: [PEAR-DEV] Standards ...

[email protected] (Mike van Riel)
Newsgroups php.pear.dev
Message-ID <[email protected]>
Lester,

First a disclaimer, I am not affiliated with the PEAR Group or even 
know
the exact history of the Coding Standards. I do however believe that 
your
question deserves a reply.

Please read my comments inline with your text,

On 18.12.2012 09:11, Lester Caine wrote:
> I'm obviously in a minority, but having checked back through ALL of
> my projects for the last ten+ years since starting to use PHP over 
> C++
> I can honestly say that I was not aware that PEAR did NOT follow what
> I took as the standard for PHP as described in the PHP
> coding_standards.

As far as I am aware has the PHP Group never advertised with their 
coding
standards, endorsed them or required them for PHP Userland Developers. 
If
you google for PHP and Coding Standards you will find that the PHP C
Coding Standard does not even show up on the first page.

In addition; it is not possible to apply the Coding Standard of PHP 
Core
development to Userland code as it contains too much C specific rules.
Adopting a Coding Standard for my projects where contributors would 
need
to ignore 90% of the document does not make sense.

> All of my copies of the PEAR packages that I use ...
> imported from other project implementations ... use tabbed format
> files. My main library ADOdb is tabbed, and all of the projects I 
> have
> worked on follow the same format. So the question I need answering is
> "WHY is the standard for PEAR actually different to the PHP
> coding_standards?"

Your previous text can be read as that you think ADOdb is part of PEAR
but to clarify: ADOdb is a separate entity that indeed uses tabs
(at least most of the time; they're not super consistent).

And if I can hazard a guess: IIRC the PEAR Coding Standards were 
derived
from the HORDE coding standards. These standards have used spaces for
a very long time.

> All right the standards document does say "Of course, we can't and
> don't want to force anybody to use a style he or she is not used to"
> which is meant to be applied to private work? But at that time I was
> already used to tabbed format files. Also the suggestion is that the
> document was never meant to apply to 'user land code', but in the
> absence of any alternative standard why would you NOT follow the core
> rules? As I have said already, why should there be one style for one
> set of files and another for in many cases the same files in a
> different usage?

See my answer a few paragraphs above; the C standards do not map onto
PHP code. For example: it requires you NOT to use '//' for commenting;
which is endorsed in the PHP Manual as the de-facto comment style for
single line comments.

> Moving forward, the suggestion is that other projects are now
> following that standard because PEAR dictates it, and the current
> proposals are to standardise on that because "That is what everybody
> uses nowadays". By default therefore we have to start managing
> different coding standards depending on what we are working on at the
> time? Rather than sticking with the one previously established
> standard?

PEAR only dictates it for their libraries and managed code; Zend
Framework, Symfony and others use it out of free choice. The coding
standard that dominates now is there because it appeals to the
largest group of (OSS) developers out there and is actually a GOOD
THING.

In the past many different coding standards were applied and it is in
the past few years that you finally see projects converge onto the
same set of rules. PSR-1 and PSR-2 are just a document containing the
most commonly found rules.

As a closing:

Even if you get answers to your questions that will satisfy you; what
do you want to do with those answers?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.