Quantcast

Poll: Should underscore prefixing of non-public elements be dropped?

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Poll: Should underscore prefixing of non-public elements be dropped?

weierophinney
Administrator
ZF Coding Standards are based on PEAR's CS. That standard was developed
first by Horde, then expanded by PEAR, during the PHP 4 lifecycle. PHP 4
had no concept of visibility in its object model; to provide some
pseudo-visibility, PEAR CS mandated that members considered non-public
should be prefixed with an underscore.

With the advent of PHP 5, PHP's object model received visibility
operators in the form of private, protected, and public. Applying PEAR
CS to PHP 5 code meant that if you marked a member as private or
protected, you would also prefix with the underscore. Many have felt
this is redundant, and also that it makes refactoring more difficult
(changes in visibility often mean renaming the members). Proponents of
the standard, however, argue that the leading underscore leads to easier
maintenance of the code -- you know immediately what the visibility of
the member you're dealing with is just by looking at it.

PEAR2 has decided to eschew the underscore prefix:

    http://wiki.pear.php.net/index.php/MeetingMinutes20080824#Underscore_prefix_on_private_.28protected.3F.29

Basically, this rule is no longer required (as it was in PEAR1), though
developers may choose to use them.

What is YOUR opinion? Should the underscore be dropped in ZF2?
Please vote!

    http://is.gd/eeA6f

Please do _not_ reply to this thread -- the arguments for and against
are well known at this time -- we're simply trying to decide on whether
or not to amend the coding standards for ZF2.

Thanks!

--
Matthew Weier O'Phinney
Project Lead            | [hidden email]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [zf-contributors] Poll: Should underscore prefixing of non-public elements be dropped?

umpirsky
Can you tell us current score? :)

Regards,
Saša Stamenković


On Thu, Aug 12, 2010 at 6:05 PM, Matthew Weier O'Phinney <[hidden email]> wrote:
ZF Coding Standards are based on PEAR's CS. That standard was developed
first by Horde, then expanded by PEAR, during the PHP 4 lifecycle. PHP 4
had no concept of visibility in its object model; to provide some
pseudo-visibility, PEAR CS mandated that members considered non-public
should be prefixed with an underscore.

With the advent of PHP 5, PHP's object model received visibility
operators in the form of private, protected, and public. Applying PEAR
CS to PHP 5 code meant that if you marked a member as private or
protected, you would also prefix with the underscore. Many have felt
this is redundant, and also that it makes refactoring more difficult
(changes in visibility often mean renaming the members). Proponents of
the standard, however, argue that the leading underscore leads to easier
maintenance of the code -- you know immediately what the visibility of
the member you're dealing with is just by looking at it.

PEAR2 has decided to eschew the underscore prefix:

   http://wiki.pear.php.net/index.php/MeetingMinutes20080824#Underscore_prefix_on_private_.28protected.3F.29

Basically, this rule is no longer required (as it was in PEAR1), though
developers may choose to use them.

What is YOUR opinion? Should the underscore be dropped in ZF2?
Please vote!

   http://is.gd/eeA6f

Please do _not_ reply to this thread -- the arguments for and against
are well known at this time -- we're simply trying to decide on whether
or not to amend the coding standards for ZF2.

Thanks!

--
Matthew Weier O'Phinney
Project Lead            | [hidden email]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [zf-contributors] Poll: Should underscore prefixing of non-public elements be dropped?

weierophinney
Administrator
-- Саша Стаменковић <[hidden email]> wrote
(on Friday, 13 August 2010, 10:14 AM +0200):
> Can you tell us current score? :)

There are currently 381 responses:

 * 57% vote "Yes" (to remove the underscores)
 * 38% vote "No" (to retain underscores)
 * 4%  vote "No opinion"

What has been interesting is that the percentages have remained
consistent from the outset -- I expected more deviation. What is also
interesting is that there is no real clear majority. Typically, I like
to see a 2/3 vote to feel comfortable that the change is widely
accepted, but that is not the case at this time.


> On Thu, Aug 12, 2010 at 6:05 PM, Matthew Weier O'Phinney <[hidden email]>
> wrote:
>
>     ZF Coding Standards are based on PEAR's CS. That standard was developed
>     first by Horde, then expanded by PEAR, during the PHP 4 lifecycle. PHP 4
>     had no concept of visibility in its object model; to provide some
>     pseudo-visibility, PEAR CS mandated that members considered non-public
>     should be prefixed with an underscore.
>
>     With the advent of PHP 5, PHP's object model received visibility
>     operators in the form of private, protected, and public. Applying PEAR
>     CS to PHP 5 code meant that if you marked a member as private or
>     protected, you would also prefix with the underscore. Many have felt
>     this is redundant, and also that it makes refactoring more difficult
>     (changes in visibility often mean renaming the members). Proponents of
>     the standard, however, argue that the leading underscore leads to easier
>     maintenance of the code -- you know immediately what the visibility of
>     the member you're dealing with is just by looking at it.
>
>     PEAR2 has decided to eschew the underscore prefix:
>
>        http://wiki.pear.php.net/index.php/MeetingMinutes20080824#
>     Underscore_prefix_on_private_.28protected.3F.29
>
>     Basically, this rule is no longer required (as it was in PEAR1), though
>     developers may choose to use them.
>
>     What is YOUR opinion? Should the underscore be dropped in ZF2?
>     Please vote!
>
>        http://is.gd/eeA6f
>
>     Please do _not_ reply to this thread -- the arguments for and against
>     are well known at this time -- we're simply trying to decide on whether
>     or not to amend the coding standards for ZF2.
>
>     Thanks!
>
>     --
>     Matthew Weier O'Phinney
>     Project Lead            | [hidden email]
>     Zend Framework          | http://framework.zend.com/
>     PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>
>

--
Matthew Weier O'Phinney
Project Lead            | [hidden email]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [zf-contributors] Poll: Should underscore prefixing of non-public elements be dropped?

umpirsky
Wow, I expected better score for "Yes"!

What will be the final decision if score remain consistent till the end?

Thanks,
Saša Stamenković


On Fri, Aug 13, 2010 at 2:45 PM, Matthew Weier O'Phinney <[hidden email]> wrote:
-- Саша Стаменковић <[hidden email]> wrote
(on Friday, 13 August 2010, 10:14 AM +0200):
> Can you tell us current score? :)

There are currently 381 responses:

 * 57% vote "Yes" (to remove the underscores)
 * 38% vote "No" (to retain underscores)
 * 4%  vote "No opinion"

What has been interesting is that the percentages have remained
consistent from the outset -- I expected more deviation. What is also
interesting is that there is no real clear majority. Typically, I like
to see a 2/3 vote to feel comfortable that the change is widely
accepted, but that is not the case at this time.


> On Thu, Aug 12, 2010 at 6:05 PM, Matthew Weier O'Phinney <[hidden email]>
> wrote:
>
>     ZF Coding Standards are based on PEAR's CS. That standard was developed
>     first by Horde, then expanded by PEAR, during the PHP 4 lifecycle. PHP 4
>     had no concept of visibility in its object model; to provide some
>     pseudo-visibility, PEAR CS mandated that members considered non-public
>     should be prefixed with an underscore.
>
>     With the advent of PHP 5, PHP's object model received visibility
>     operators in the form of private, protected, and public. Applying PEAR
>     CS to PHP 5 code meant that if you marked a member as private or
>     protected, you would also prefix with the underscore. Many have felt
>     this is redundant, and also that it makes refactoring more difficult
>     (changes in visibility often mean renaming the members). Proponents of
>     the standard, however, argue that the leading underscore leads to easier
>     maintenance of the code -- you know immediately what the visibility of
>     the member you're dealing with is just by looking at it.
>
>     PEAR2 has decided to eschew the underscore prefix:
>
>        http://wiki.pear.php.net/index.php/MeetingMinutes20080824#
>     Underscore_prefix_on_private_.28protected.3F.29
>
>     Basically, this rule is no longer required (as it was in PEAR1), though
>     developers may choose to use them.
>
>     What is YOUR opinion? Should the underscore be dropped in ZF2?
>     Please vote!
>
>        http://is.gd/eeA6f
>
>     Please do _not_ reply to this thread -- the arguments for and against
>     are well known at this time -- we're simply trying to decide on whether
>     or not to amend the coding standards for ZF2.
>
>     Thanks!
>
>     --
>     Matthew Weier O'Phinney
>     Project Lead            | [hidden email]
>     Zend Framework          | http://framework.zend.com/
>     PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>
>

--
Matthew Weier O'Phinney
Project Lead            | [hidden email]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [zf-contributors] Poll: Should underscore prefixing of non-public elements be dropped?

xoops
In reply to this post by weierophinney
I only for myself:
I was the first one replying your email of "General inclinations
regarding prefixing non-public members?" with "No underscore".
But I did not participate your poll for I really don't understand your
intention of creating a poll after you had that email and so many
people already responded.


On Fri, Aug 13, 2010 at 8:45 PM, Matthew Weier O'Phinney
<[hidden email]> wrote:

>
> -- Саша Стаменковић <[hidden email]> wrote
> (on Friday, 13 August 2010, 10:14 AM +0200):
> > Can you tell us current score? :)
>
> There are currently 381 responses:
>
>  * 57% vote "Yes" (to remove the underscores)
>  * 38% vote "No" (to retain underscores)
>  * 4%  vote "No opinion"
>
> What has been interesting is that the percentages have remained
> consistent from the outset -- I expected more deviation. What is also
> interesting is that there is no real clear majority. Typically, I like
> to see a 2/3 vote to feel comfortable that the change is widely
> accepted, but that is not the case at this time.
>
>
> > On Thu, Aug 12, 2010 at 6:05 PM, Matthew Weier O'Phinney <[hidden email]>
> > wrote:
> >
> >     ZF Coding Standards are based on PEAR's CS. That standard was developed
> >     first by Horde, then expanded by PEAR, during the PHP 4 lifecycle. PHP 4
> >     had no concept of visibility in its object model; to provide some
> >     pseudo-visibility, PEAR CS mandated that members considered non-public
> >     should be prefixed with an underscore.
> >
> >     With the advent of PHP 5, PHP's object model received visibility
> >     operators in the form of private, protected, and public. Applying PEAR
> >     CS to PHP 5 code meant that if you marked a member as private or
> >     protected, you would also prefix with the underscore. Many have felt
> >     this is redundant, and also that it makes refactoring more difficult
> >     (changes in visibility often mean renaming the members). Proponents of
> >     the standard, however, argue that the leading underscore leads to easier
> >     maintenance of the code -- you know immediately what the visibility of
> >     the member you're dealing with is just by looking at it.
> >
> >     PEAR2 has decided to eschew the underscore prefix:
> >
> >        http://wiki.pear.php.net/index.php/MeetingMinutes20080824#
> >     Underscore_prefix_on_private_.28protected.3F.29
> >
> >     Basically, this rule is no longer required (as it was in PEAR1), though
> >     developers may choose to use them.
> >
> >     What is YOUR opinion? Should the underscore be dropped in ZF2?
> >     Please vote!
> >
> >        http://is.gd/eeA6f
> >
> >     Please do _not_ reply to this thread -- the arguments for and against
> >     are well known at this time -- we're simply trying to decide on whether
> >     or not to amend the coding standards for ZF2.
> >
> >     Thanks!
> >
> >     --
> >     Matthew Weier O'Phinney
> >     Project Lead            | [hidden email]
> >     Zend Framework          | http://framework.zend.com/
> >     PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
> >
> >
>
> --
> Matthew Weier O'Phinney
> Project Lead            | [hidden email]
> Zend Framework          | http://framework.zend.com/
> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc



--
Dev Lead for Xoops Engine
Internet Application R&D @PerfectWorld
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [zf-contributors] Poll: Should underscore prefixing of non-public elements be dropped?

xoops
BTW, I would like to let you know that the vote link is blocked in my
country in case you don't think votes from my country don't make
difference.

On Fri, Aug 13, 2010 at 11:11 PM, D. J. <[hidden email]> wrote:

> I only for myself:
> I was the first one replying your email of "General inclinations
> regarding prefixing non-public members?" with "No underscore".
> But I did not participate your poll for I really don't understand your
> intention of creating a poll after you had that email and so many
> people already responded.
>
>
> On Fri, Aug 13, 2010 at 8:45 PM, Matthew Weier O'Phinney
> <[hidden email]> wrote:
>>
>> -- Саша Стаменковић <[hidden email]> wrote
>> (on Friday, 13 August 2010, 10:14 AM +0200):
>> > Can you tell us current score? :)
>>
>> There are currently 381 responses:
>>
>>  * 57% vote "Yes" (to remove the underscores)
>>  * 38% vote "No" (to retain underscores)
>>  * 4%  vote "No opinion"
>>
>> What has been interesting is that the percentages have remained
>> consistent from the outset -- I expected more deviation. What is also
>> interesting is that there is no real clear majority. Typically, I like
>> to see a 2/3 vote to feel comfortable that the change is widely
>> accepted, but that is not the case at this time.
>>
>>
>> > On Thu, Aug 12, 2010 at 6:05 PM, Matthew Weier O'Phinney <[hidden email]>
>> > wrote:
>> >
>> >     ZF Coding Standards are based on PEAR's CS. That standard was developed
>> >     first by Horde, then expanded by PEAR, during the PHP 4 lifecycle. PHP 4
>> >     had no concept of visibility in its object model; to provide some
>> >     pseudo-visibility, PEAR CS mandated that members considered non-public
>> >     should be prefixed with an underscore.
>> >
>> >     With the advent of PHP 5, PHP's object model received visibility
>> >     operators in the form of private, protected, and public. Applying PEAR
>> >     CS to PHP 5 code meant that if you marked a member as private or
>> >     protected, you would also prefix with the underscore. Many have felt
>> >     this is redundant, and also that it makes refactoring more difficult
>> >     (changes in visibility often mean renaming the members). Proponents of
>> >     the standard, however, argue that the leading underscore leads to easier
>> >     maintenance of the code -- you know immediately what the visibility of
>> >     the member you're dealing with is just by looking at it.
>> >
>> >     PEAR2 has decided to eschew the underscore prefix:
>> >
>> >        http://wiki.pear.php.net/index.php/MeetingMinutes20080824#
>> >     Underscore_prefix_on_private_.28protected.3F.29
>> >
>> >     Basically, this rule is no longer required (as it was in PEAR1), though
>> >     developers may choose to use them.
>> >
>> >     What is YOUR opinion? Should the underscore be dropped in ZF2?
>> >     Please vote!
>> >
>> >        http://is.gd/eeA6f
>> >
>> >     Please do _not_ reply to this thread -- the arguments for and against
>> >     are well known at this time -- we're simply trying to decide on whether
>> >     or not to amend the coding standards for ZF2.
>> >
>> >     Thanks!
>> >
>> >     --
>> >     Matthew Weier O'Phinney
>> >     Project Lead            | [hidden email]
>> >     Zend Framework          | http://framework.zend.com/
>> >     PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>> >
>> >
>>
>> --
>> Matthew Weier O'Phinney
>> Project Lead            | [hidden email]
>> Zend Framework          | http://framework.zend.com/
>> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>
>
>
> --
> Dev Lead for Xoops Engine
> Internet Application R&D @PerfectWorld
>



--
Dev Lead for Xoops Engine
Internet Application R&D @PerfectWorld
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [zf-contributors] Poll: Should underscore prefixing of non-public elements be dropped?

padraicb
In reply to this post by weierophinney
Presumably the poll was held was to gauge support among framework users and not just members of the contributor mailing list. That the poll is blocked in your country may be either the poll host or the URL shortener service. Doubt it was intentional! ;)

Paddy

On 13 Aug 2010, at 16:11, "D. J." <[hidden email]> wrote:

I only for myself:
I was the first one replying your email of "General inclinations
regarding prefixing non-public members?" with "No underscore".
But I did not participate your poll for I really don't understand your
intention of creating a poll after you had that email and so many
people already responded.


On Fri, Aug 13, 2010 at 8:45 PM, Matthew Weier O'Phinney
<[hidden email]> wrote:

-- Саша Стаменковић <[hidden email]> wrote
(on Friday, 13 August 2010, 10:14 AM +0200):
Can you tell us current score? :)

There are currently 381 responses:

 * 57% vote "Yes" (to remove the underscores)
 * 38% vote "No" (to retain underscores)
 * 4%  vote "No opinion"

What has been interesting is that the percentages have remained
consistent from the outset -- I expected more deviation. What is also
interesting is that there is no real clear majority. Typically, I like
to see a 2/3 vote to feel comfortable that the change is widely
accepted, but that is not the case at this time.


On Thu, Aug 12, 2010 at 6:05 PM, Matthew Weier O'Phinney <[hidden email]>
wrote:

    ZF Coding Standards are based on PEAR's CS. That standard was developed
    first by Horde, then expanded by PEAR, during the PHP 4 lifecycle. PHP 4
    had no concept of visibility in its object model; to provide some
    pseudo-visibility, PEAR CS mandated that members considered non-public
    should be prefixed with an underscore.

    With the advent of PHP 5, PHP's object model received visibility
    operators in the form of private, protected, and public. Applying PEAR
    CS to PHP 5 code meant that if you marked a member as private or
    protected, you would also prefix with the underscore. Many have felt
    this is redundant, and also that it makes refactoring more difficult
    (changes in visibility often mean renaming the members). Proponents of
    the standard, however, argue that the leading underscore leads to easier
    maintenance of the code -- you know immediately what the visibility of
    the member you're dealing with is just by looking at it.

    PEAR2 has decided to eschew the underscore prefix:

       http://wiki.pear.php.net/index.php/MeetingMinutes20080824#
    Underscore_prefix_on_private_.28protected.3F.29

    Basically, this rule is no longer required (as it was in PEAR1), though
    developers may choose to use them.

    What is YOUR opinion? Should the underscore be dropped in ZF2?
    Please vote!

       http://is.gd/eeA6f

    Please do _not_ reply to this thread -- the arguments for and against
    are well known at this time -- we're simply trying to decide on whether
    or not to amend the coding standards for ZF2.

    Thanks!

    --
    Matthew Weier O'Phinney
    Project Lead            | [hidden email]
    Zend Framework          | http://framework.zend.com/
    PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc



--
Matthew Weier O'Phinney
Project Lead            | [hidden email]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc



--
Dev Lead for Xoops Engine
Internet Application R&D @PerfectWorld

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [zf-contributors] Poll: Should underscore prefixing of non-public elements be dropped?

xoops
Googledocs is partially blocked.
Unfortunately, Googlesheets is among the blocked.

On Fri, Aug 13, 2010 at 11:28 PM, Pádraic Brady <[hidden email]> wrote:

> Presumably the poll was held was to gauge support among framework users and not just members of the contributor mailing list. That the poll is blocked in your country may be either the poll host or the URL shortener service. Doubt it was intentional! ;)
>
> Paddy
>
> On 13 Aug 2010, at 16:11, "D. J." <[hidden email]> wrote:
>
> I only for myself:
> I was the first one replying your email of "General inclinations
> regarding prefixing non-public members?" with "No underscore".
> But I did not participate your poll for I really don't understand your
> intention of creating a poll after you had that email and so many
> people already responded.
>
>
> On Fri, Aug 13, 2010 at 8:45 PM, Matthew Weier O'Phinney
> <[hidden email]> wrote:
>
> -- Саша Стаменковић <[hidden email]> wrote
> (on Friday, 13 August 2010, 10:14 AM +0200):
> Can you tell us current score? :)
>
> There are currently 381 responses:
>
>  * 57% vote "Yes" (to remove the underscores)
>  * 38% vote "No" (to retain underscores)
>  * 4%  vote "No opinion"
>
> What has been interesting is that the percentages have remained
> consistent from the outset -- I expected more deviation. What is also
> interesting is that there is no real clear majority. Typically, I like
> to see a 2/3 vote to feel comfortable that the change is widely
> accepted, but that is not the case at this time.
>
>
> On Thu, Aug 12, 2010 at 6:05 PM, Matthew Weier O'Phinney <[hidden email]>
> wrote:
>
>    ZF Coding Standards are based on PEAR's CS. That standard was developed
>    first by Horde, then expanded by PEAR, during the PHP 4 lifecycle. PHP 4
>    had no concept of visibility in its object model; to provide some
>    pseudo-visibility, PEAR CS mandated that members considered non-public
>    should be prefixed with an underscore.
>
>    With the advent of PHP 5, PHP's object model received visibility
>    operators in the form of private, protected, and public. Applying PEAR
>    CS to PHP 5 code meant that if you marked a member as private or
>    protected, you would also prefix with the underscore. Many have felt
>    this is redundant, and also that it makes refactoring more difficult
>    (changes in visibility often mean renaming the members). Proponents of
>    the standard, however, argue that the leading underscore leads to easier
>    maintenance of the code -- you know immediately what the visibility of
>    the member you're dealing with is just by looking at it.
>
>    PEAR2 has decided to eschew the underscore prefix:
>
>       http://wiki.pear.php.net/index.php/MeetingMinutes20080824#
>    Underscore_prefix_on_private_.28protected.3F.29
>
>    Basically, this rule is no longer required (as it was in PEAR1), though
>    developers may choose to use them.
>
>    What is YOUR opinion? Should the underscore be dropped in ZF2?
>    Please vote!
>
>       http://is.gd/eeA6f
>
>    Please do _not_ reply to this thread -- the arguments for and against
>    are well known at this time -- we're simply trying to decide on whether
>    or not to amend the coding standards for ZF2.
>
>    Thanks!
>
>    --
>    Matthew Weier O'Phinney
>    Project Lead            | [hidden email]
>    Zend Framework          | http://framework.zend.com/
>    PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>
>
>
> --
> Matthew Weier O'Phinney
> Project Lead            | [hidden email]
> Zend Framework          | http://framework.zend.com/
> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>
>
>
> --
> Dev Lead for Xoops Engine
> Internet Application R&D @PerfectWorld
>
>



--
Dev Lead for Xoops Engine
Internet Application R&D @PerfectWorld
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [zf-contributors] Poll: Should underscore prefixing of non-public elements be dropped?

weierophinney
Administrator
In reply to this post by xoops
-- D. J. <[hidden email]> wrote
(on Friday, 13 August 2010, 11:11 PM +0800):
> I only for myself:
> I was the first one replying your email of "General inclinations
> regarding prefixing non-public members?" with "No underscore".
> But I did not participate your poll for I really don't understand your
> intention of creating a poll after you had that email and so many
> people already responded.


Because it's one thing to ask contributors, and another entirely to
poll the general community. While this decision would primarily affect
contributors, it also affects anyone who extends ZF classes, as well as
those who adopt the ZF coding standards. As such, it's important to get
a broader viewpoint.

If you had feedback on the mailing list, I encourage you to also vote in
the poll.


> On Fri, Aug 13, 2010 at 8:45 PM, Matthew Weier O'Phinney
> <[hidden email]> wrote:
> >
> > -- Саша Стаменковић <[hidden email]> wrote
> > (on Friday, 13 August 2010, 10:14 AM +0200):
> > > Can you tell us current score? :)
> >
> > There are currently 381 responses:
> >
> >  * 57% vote "Yes" (to remove the underscores)
> >  * 38% vote "No" (to retain underscores)
> >  * 4%  vote "No opinion"
> >
> > What has been interesting is that the percentages have remained
> > consistent from the outset -- I expected more deviation. What is also
> > interesting is that there is no real clear majority. Typically, I like
> > to see a 2/3 vote to feel comfortable that the change is widely
> > accepted, but that is not the case at this time.
> >
> >
> > > On Thu, Aug 12, 2010 at 6:05 PM, Matthew Weier O'Phinney <[hidden email]>
> > > wrote:
> > >
> > >     ZF Coding Standards are based on PEAR's CS. That standard was developed
> > >     first by Horde, then expanded by PEAR, during the PHP 4 lifecycle. PHP 4
> > >     had no concept of visibility in its object model; to provide some
> > >     pseudo-visibility, PEAR CS mandated that members considered non-public
> > >     should be prefixed with an underscore.
> > >
> > >     With the advent of PHP 5, PHP's object model received visibility
> > >     operators in the form of private, protected, and public. Applying PEAR
> > >     CS to PHP 5 code meant that if you marked a member as private or
> > >     protected, you would also prefix with the underscore. Many have felt
> > >     this is redundant, and also that it makes refactoring more difficult
> > >     (changes in visibility often mean renaming the members). Proponents of
> > >     the standard, however, argue that the leading underscore leads to easier
> > >     maintenance of the code -- you know immediately what the visibility of
> > >     the member you're dealing with is just by looking at it.
> > >
> > >     PEAR2 has decided to eschew the underscore prefix:
> > >
> > >        http://wiki.pear.php.net/index.php/MeetingMinutes20080824#
> > >     Underscore_prefix_on_private_.28protected.3F.29
> > >
> > >     Basically, this rule is no longer required (as it was in PEAR1), though
> > >     developers may choose to use them.
> > >
> > >     What is YOUR opinion? Should the underscore be dropped in ZF2?
> > >     Please vote!
> > >
> > >        http://is.gd/eeA6f
> > >
> > >     Please do _not_ reply to this thread -- the arguments for and against
> > >     are well known at this time -- we're simply trying to decide on whether
> > >     or not to amend the coding standards for ZF2.
> > >
> > >     Thanks!
> > >
> > >     --
> > >     Matthew Weier O'Phinney
> > >     Project Lead            | [hidden email]
> > >     Zend Framework          | http://framework.zend.com/
> > >     PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
> > >
> > >
> >
> > --
> > Matthew Weier O'Phinney
> > Project Lead            | [hidden email]
> > Zend Framework          | http://framework.zend.com/
> > PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>
>
>
> --
> Dev Lead for Xoops Engine
> Internet Application R&D @PerfectWorld
>

--
Matthew Weier O'Phinney
Project Lead            | [hidden email]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [zf-contributors] Poll: Should underscore prefixing of non-public elements be dropped?

weierophinney
Administrator
In reply to this post by xoops
-- D. J. <[hidden email]> wrote
(on Friday, 13 August 2010, 11:16 PM +0800):
> BTW, I would like to let you know that the vote link is blocked in my
> country in case you don't think votes from my country don't make
> difference.

Can you try going to the canonical URL, then:

    https://spreadsheets.google.com/viewform?formkey=dEZOTGpMdjhzZDlmZGNMZVF0WnFTV2c6MQ

If you cannot reach that, let me know.

> On Fri, Aug 13, 2010 at 11:11 PM, D. J. <[hidden email]> wrote:
> > I only for myself:
> > I was the first one replying your email of "General inclinations
> > regarding prefixing non-public members?" with "No underscore".
> > But I did not participate your poll for I really don't understand your
> > intention of creating a poll after you had that email and so many
> > people already responded.
> >
> >
> > On Fri, Aug 13, 2010 at 8:45 PM, Matthew Weier O'Phinney
> > <[hidden email]> wrote:
> >>
> >> -- Саша Стаменковић <[hidden email]> wrote
> >> (on Friday, 13 August 2010, 10:14 AM +0200):
> >> > Can you tell us current score? :)
> >>
> >> There are currently 381 responses:
> >>
> >>  * 57% vote "Yes" (to remove the underscores)
> >>  * 38% vote "No" (to retain underscores)
> >>  * 4%  vote "No opinion"
> >>
> >> What has been interesting is that the percentages have remained
> >> consistent from the outset -- I expected more deviation. What is also
> >> interesting is that there is no real clear majority. Typically, I like
> >> to see a 2/3 vote to feel comfortable that the change is widely
> >> accepted, but that is not the case at this time.
> >>
> >>
> >> > On Thu, Aug 12, 2010 at 6:05 PM, Matthew Weier O'Phinney <[hidden email]>
> >> > wrote:
> >> >
> >> >     ZF Coding Standards are based on PEAR's CS. That standard was developed
> >> >     first by Horde, then expanded by PEAR, during the PHP 4 lifecycle. PHP 4
> >> >     had no concept of visibility in its object model; to provide some
> >> >     pseudo-visibility, PEAR CS mandated that members considered non-public
> >> >     should be prefixed with an underscore.
> >> >
> >> >     With the advent of PHP 5, PHP's object model received visibility
> >> >     operators in the form of private, protected, and public. Applying PEAR
> >> >     CS to PHP 5 code meant that if you marked a member as private or
> >> >     protected, you would also prefix with the underscore. Many have felt
> >> >     this is redundant, and also that it makes refactoring more difficult
> >> >     (changes in visibility often mean renaming the members). Proponents of
> >> >     the standard, however, argue that the leading underscore leads to easier
> >> >     maintenance of the code -- you know immediately what the visibility of
> >> >     the member you're dealing with is just by looking at it.
> >> >
> >> >     PEAR2 has decided to eschew the underscore prefix:
> >> >
> >> >        http://wiki.pear.php.net/index.php/MeetingMinutes20080824#
> >> >     Underscore_prefix_on_private_.28protected.3F.29
> >> >
> >> >     Basically, this rule is no longer required (as it was in PEAR1), though
> >> >     developers may choose to use them.
> >> >
> >> >     What is YOUR opinion? Should the underscore be dropped in ZF2?
> >> >     Please vote!
> >> >
> >> >        http://is.gd/eeA6f
> >> >
> >> >     Please do _not_ reply to this thread -- the arguments for and against
> >> >     are well known at this time -- we're simply trying to decide on whether
> >> >     or not to amend the coding standards for ZF2.
> >> >
> >> >     Thanks!
> >> >
> >> >     --
> >> >     Matthew Weier O'Phinney
> >> >     Project Lead            | [hidden email]
> >> >     Zend Framework          | http://framework.zend.com/
> >> >     PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
> >> >
> >> >
> >>
> >> --
> >> Matthew Weier O'Phinney
> >> Project Lead            | [hidden email]
> >> Zend Framework          | http://framework.zend.com/
> >> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
> >
> >
> >
> > --
> > Dev Lead for Xoops Engine
> > Internet Application R&D @PerfectWorld
> >
>
>
>
> --
> Dev Lead for Xoops Engine
> Internet Application R&D @PerfectWorld
>

--
Matthew Weier O'Phinney
Project Lead            | [hidden email]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [zf-contributors] Poll: Should underscore prefixing of non-public elements be dropped?

Vincent de Lau
> -----Oorspronkelijk bericht-----
> Van: Matthew Weier O'Phinney [mailto:[hidden email]]
> Verzonden: vrijdag 13 augustus 2010 18:27
> Aan: [hidden email]; [hidden email]
> Onderwerp: Re: [fw-general] Re: [zf-contributors] Poll: Should underscore
> prefixing of non-public elements be dropped?
>
> -- D. J. <[hidden email]> wrote
> (on Friday, 13 August 2010, 11:16 PM +0800):
> > BTW, I would like to let you know that the vote link is blocked in my
> > country in case you don't think votes from my country don't make
> > difference.
>
> Can you try going to the canonical URL, then:
>
>
> https://spreadsheets.google.com/viewform?formkey=dEZOTGpMdjhzZDlmZGNMZVF0WnFTV
> 2c6MQ
>
> If you cannot reach that, let me know.

Vote by mail ;)

Vincent

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [zf-contributors] Poll: Should underscore prefixing of non-public elements be dropped?

ixti
Hello,

Does elimination of underscores corresponds only to protected or private too?
Because IMHO underscores should be removed from protected methods only.
So private should have one underscore prefix. Such convention will allow to:

1. Absolutely clearly see that method is not a magic one (silly, but
still good point)
2. Have private and protected method doing something with similar name but
different scopes:

class MyClass
{
    private function _doSomething()
    { /* ... */ }

    protected function doSomething()
    {
        // protected doSomething mangling some results by default
        return strtolower($this->_doSomething());
    }

    private function _doSomethingThatDataSensitive()
    {
        $data = $this->_doSomething();
    }
}


But I mght be wrong and this will just make rules too complex. Anyway I vote for
underscores removal :))


2010/8/13 Vincent de Lau <[hidden email]>:

>> -----Oorspronkelijk bericht-----
>> Van: Matthew Weier O'Phinney [mailto:[hidden email]]
>> Verzonden: vrijdag 13 augustus 2010 18:27
>> Aan: [hidden email]; [hidden email]
>> Onderwerp: Re: [fw-general] Re: [zf-contributors] Poll: Should underscore
>> prefixing of non-public elements be dropped?
>>
>> -- D. J. <[hidden email]> wrote
>> (on Friday, 13 August 2010, 11:16 PM +0800):
>> > BTW, I would like to let you know that the vote link is blocked in my
>> > country in case you don't think votes from my country don't make
>> > difference.
>>
>> Can you try going to the canonical URL, then:
>>
>>
>> https://spreadsheets.google.com/viewform?formkey=dEZOTGpMdjhzZDlmZGNMZVF0WnFTV
>> 2c6MQ
>>
>> If you cannot reach that, let me know.
>
> Vote by mail ;)
>
> Vincent
>
>



--
Sincerely yours,
Aleksey V. Zapparov A.K.A. ixti
FSF Member #7118
Mobile Phone: +34 617 179 344
Homepage: http://www.ixti.ru
JID: [hidden email]

*Origin: Happy Hacking!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [zf-contributors] Re: [fw-general] Re: [zf-contributors] Poll: Should underscore prefixing of non-public elements be dropped?

Nicolas A. Bérard-Nault
Hi,

Having methods with the same name but prefixed differently is a very bad idea. I cannot stress this enough. From such a nomenclature abuse rises confusion and bad design decisions. At any moment, if you feel this is necessary, you should reconsider how you organize your methods and how you build your class. Uncle Bob's SOLID principles are a good start.

NABN.

On Sun, Aug 15, 2010 at 7:25 AM, Aleksey Zapparov <[hidden email]> wrote:
Hello,

Does elimination of underscores corresponds only to protected or private too?
Because IMHO underscores should be removed from protected methods only.
So private should have one underscore prefix. Such convention will allow to:

1. Absolutely clearly see that method is not a magic one (silly, but
still good point)
2. Have private and protected method doing something with similar name but
different scopes:

class MyClass
{
   private function _doSomething()
   { /* ... */ }

   protected function doSomething()
   {
       // protected doSomething mangling some results by default
       return strtolower($this->_doSomething());
   }

   private function _doSomethingThatDataSensitive()
   {
       $data = $this->_doSomething();
   }
}


But I mght be wrong and this will just make rules too complex. Anyway I vote for
underscores removal :))


2010/8/13 Vincent de Lau <[hidden email]>:
>> -----Oorspronkelijk bericht-----
>> Van: Matthew Weier O'Phinney [mailto:[hidden email]]
>> Verzonden: vrijdag 13 augustus 2010 18:27
>> Aan: [hidden email]; [hidden email]
>> Onderwerp: Re: [fw-general] Re: [zf-contributors] Poll: Should underscore
>> prefixing of non-public elements be dropped?
>>
>> -- D. J. <[hidden email]> wrote
>> (on Friday, 13 August 2010, 11:16 PM +0800):
>> > BTW, I would like to let you know that the vote link is blocked in my
>> > country in case you don't think votes from my country don't make
>> > difference.
>>
>> Can you try going to the canonical URL, then:
>>
>>
>> https://spreadsheets.google.com/viewform?formkey=dEZOTGpMdjhzZDlmZGNMZVF0WnFTV
>> 2c6MQ
>>
>> If you cannot reach that, let me know.
>
> Vote by mail ;)
>
> Vincent
>
>



--
Sincerely yours,
Aleksey V. Zapparov A.K.A. ixti
FSF Member #7118
Mobile Phone: +34 617 179 344
Homepage: http://www.ixti.ru
JID: [hidden email]

*Origin: Happy Hacking!



--
Nicolas A. Bérard-Nault ([hidden email])
Loading...