Re: PHP Standard style of writing your code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2006-04-29 at 01:38, Rafael wrote:
> 	IMHO, vertical aligned brackets can be messy when nesting

Explain messy!?

> relatively-small blocks (and seems to me like a lot of wasted space)

Did you just say wasted space? I mean it's not like 99.9% (pulled from
the dark recesses of my behind) of code gets printed. So that leaves
wasted space on what? My 500 gigs of HD space? You are kidding right?!

> A couple of facts of my codding style:

beat it over a head, gut it, cook over an open fire? ;)

> - I tend to always use brakets, so I ignore the fact that single

Are they tools to help you slow down?

>    lines/actions can be written without brackets,

I do so also, it's just good maintenance style since adding code to the
conditional doesn't require adding the braces in the future.

> - I try not to let lines grow larger than about 100 cols (cannot
>    be really done with strings and other thingies, and maybe that
>    should remain in the old 80 cols, but it's too litle space), and

I still keep my lines at 80... on rare cases 81 :)

> - I use a 4 space indentation, and that alone suffices for making
>    a block stand clear enough

Ditto... but those vertically aligned braces just make it eve clearer.

> 	So, in my case, the code would be something like
>    function foo( $x ) {
>        // body...
>    }
>    ···
>    $a = foo($b);

Yeah, you're in the lynch camp... yeeeeeeeeeeuck ;)

Cheers,
Rob.

> Chris W. Parker wrote:
> >> So no matter what was actually typed, *I* would see:
> >> 
> >>function foo ($x) {
> >>  //body
> >>}
> >>
> >>but some heretic who doesn't know any better would see:
> >>function foo($x)
> >>{
> >>  //body
> >>}
> [···]
> > Setting aside the fact that you're completely wrong about your
> > preference... ;)
> > 
> > What, in your mind, is the advantage to putting the opening brace on
> > the same line as the function call, logic statement, etc.? (Btw, this
> > is a serious question!)
> [···]
> P.S.	What, in your mind, is the advantage of replying after quoting the 
> original message and not before? :)

Standard netiquette. Only top post when fighting the power :B

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux