Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: [propel-dev] Coding Standards

propel
Discussion topic

Back to topic list

Re: [propel-dev] Coding Standards

Reply

Author hlellelid
Full name Hans Lellelid
Date 2006-09-21 06:12:47 PDT
Message Hi Cameron,

Ok, sounds good. I agree with you on standards, though I've [obviously]
been a bit lax at enforcing them. I think we agree then on not turning
away code, but that we will ensure that releases adhere to standards.

You're suggestions are fine. For phpdoc, I personally like the PEAR style:

/**
 * One line description.
 * More content
 * @param string $p1 Desc of param
 * @returns boolean Desc of return
 */
public static function myFunc($p1) {
  // ...
}

I think there is a coding style page on the wiki. Feel free to update
that with your suggestions, etc.

Hans

Cameron Brunner wrote:
> I'm for accepting patches with wrong coding rules only for us to come
> along later and fix them up however i would state that we should
> enforce a RELEASE version of propel to be fully compliant with the
> coding standards. I'm also for getting strict with the rules. I am
> actually looking into using php code sniffer (check pear) to do this
> for us (including notifying us of the generated code problems).
>
> Tabs - agreed, set it to 2 4 or 8 depending on your own preference
> class and function {}'s - opening on the same line as the definition
> extra whitespace often - if ( $blah == $blahblah ) not
> if($blah==$blahblah)
> extra linebreak after { and }
> extra linebreak in anything in the same function that is for anything
> too different ($query stuff then $criteria stuff should be broken
> apart)
>
> Thats just a few things id like to see personally off the top of my
> head. Anyone got any comments about these? What rules for phpdoc
> comments?
>
> On 9/21/06, Hans Lellelid <hans at velum dot net> wrote:
>> Ok, I agree. (And I -- or at least my editors -- are probably partly to
>> blame for inconsistencies.)
>>
>> - Definitely unix line endings should be standard (there I know that
>> I'm at fault for having misset defaults at some point in PHPEdit.)
>> - I personally prefer tabs for whitespace, though I'm open to
>> discussion on that.
>> - I do most of my editing in GUI editors (like PHPEdit or Eclipse), so
>> I also don't like editor-specific markup in the files (I guess I'm
>> thinking of vim).
>>
>> I'm very fine with having coding guidelines, but I don't want to
>> overstep that line where the coding standards are just arbitrary rules
>> to enforce or use as a basis for rejecting contributed work (e.g. PEAR).
>>
>> Other thoughts?
>>
>> Hans
>>
>> Cameron Brunner wrote:
>> > After delving thru the codebase i have been seeing functions use
>> > spaces for indentation (4space) and tabs used half way thru (tabs set
>> > to 8 on my vim), can we start to enforce some sort of coding
>> > standards? I'm even happy enough to go thru every file myself and
>> > setup the standards we agree on.
>> >
>> >
>> > Cameron
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>

« Previous message in topic | 4 of 22 | Next message in topic »

Messages

Show all messages in topic

Coding Standards Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2006-09-20 21:21:50 PDT
     Re: [propel-dev] Coding Standards hlellelid Hans Lellelid 2006-09-21 05:44:54 PDT
         Re: [propel-dev] Coding Standards Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2006-09-21 06:03:09 PDT
             Re: [propel-dev] Coding Standards hlellelid Hans Lellelid 2006-09-21 06:12:47 PDT
                 Re: [propel-dev] Coding Standards Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2006-09-21 06:40:12 PDT
                     Re: [propel-dev] Coding Standards Ron Rademaker <r dot rademaker at virtualbuilding dot nl> Ron Rademaker <r dot rademaker at virtualbuilding dot nl> 2006-09-21 06:47:09 PDT
                         Re: [propel-dev] Coding Standards Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2006-09-21 06:53:32 PDT
                             Re: [propel-dev] Coding Standards Ron Rademaker <r dot rademaker at virtualbuilding dot nl> Ron Rademaker <r dot rademaker at virtualbuilding dot nl> 2006-09-21 06:58:56 PDT
                                 Re: [propel-dev] Coding Standards =?UTF-8?B?RXZlbiBBbmRyw6kgRmlza3Zpaw==?= <even at lynweb dot no> =?UTF-8?B?RXZlbiBBbmRyw6kgRmlza3Zpaw==?= <even at lynweb dot no> 2006-09-21 07:02:34 PDT
                             Re: [propel-dev] Coding Standards hlellelid Hans Lellelid 2006-09-21 07:03:20 PDT
                                 Re: [propel-dev] Coding Standards Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2006-09-21 07:25:26 PDT
                                     Re: [propel-dev] Coding Standards hlellelid Hans Lellelid 2006-09-21 07:27:23 PDT
                                         Re: [propel-dev] Coding Standards =?UTF-8?B?RXZlbiBBbmRyw6kgRmlza3Zpaw==?= <even at lynweb dot no> =?UTF-8?B?RXZlbiBBbmRyw6kgRmlza3Zpaw==?= <even at lynweb dot no> 2006-09-21 07:31:05 PDT
                                             Re: [propel-dev] Coding Standards Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-09-21 07:36:02 PDT
                                 Re: [propel-dev] Coding Standards =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2006-09-23 07:18:45 PDT
                                     Re: [propel-dev] Coding Standards hlellelid Hans Lellelid 2006-09-23 07:22:03 PDT
                                         Re: [propel-dev] Coding Standards =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2006-09-23 07:43:10 PDT
                                 Re: [propel-dev] Coding Standards Carl Parrish <cparrish at pcl-consulting dot com> Carl Parrish <cparrish at pcl-consulting dot com> 2006-12-06 07:54:51 PST
                         Re: [propel-dev] Coding Standards Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-09-21 07:33:25 PDT
                             Re: [propel-dev] Coding Standards hlellelid Hans Lellelid 2006-09-21 07:42:40 PDT
                                 Re: [propel-dev] Coding Standards Ron Rademaker <r dot rademaker at virtualbuilding dot nl> Ron Rademaker <r dot rademaker at virtualbuilding dot nl> 2006-09-21 07:46:43 PDT
         Re: [propel-dev] Coding Standards Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-09-21 07:38:56 PDT
Messages per page: