Re: indent? [was: Comment block style]
| From: | Jon Parise | Date: | Tue, 25 Sep 2001 22:14:43 +0000 |
| Subject: | Re: indent? [was: Comment block style] | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-2049@lists.php.net to get a copy of this message | ||
On Wed, Sep 26, 2001 at 12:10:07AM +0200, Nicolas Hoizey wrote:
> > Seriously: my reason for supporting the "spaces only" format is that
> > it's the only thing that looks the same in any program.
>
> I've seen a lot of messages about this topic, and I still don't agree
> with this indentation standard. Some like 4 spaces indenting and
> others like 8 spaces indenting.
>
> With tabs, anybody can configure its own software to make it look as
> he wants to. This can't be done with spaces.
That's the major misconception here, so I'll repeat why this
isn't entirely true:
If one person represents a tab character as eight columns and the
other represents it as four columns, there is a chance that the
code formatted for four column tabs will exceed the 80 column
character limit on a eight column tabber's screen.
Also, certain code formatting will only line up if the tab size
remains constant, e.g.:
if ($result == $MyObject->someMethod($data1, $data2, $data3,
$data4, $data5)) {
statement;
}
If only tabs were used to format the above code sample, the
second line would only line up using the original formatter's tab
setting.
> Anyway, I know I won't change anything with my humble opinion about
> it, but this should be very carrefully explained in the Coding
> Standard.
It's explained in detail in the archives and in other resources.
The coding standard should just define the standard; it needn't
explain and justify it. No one would read it if it were a large
document.
The only standard I'm really willing support that includes tabs
_at all_ is the four-column tab standard used in the PHP C source
code.
--
Jon Parise (jon@csh.rit.edu) . Information Technology (B.S.)
http://www.csh.rit.edu/~jon/ : Computer Science House
Member