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 <[email protected]>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 <[email protected]>:
> >> -----Oorspronkelijk bericht-----
> >> Van: Matthew Weier O'Phinney [mailto:[email protected]]
> >> Verzonden: vrijdag 13 augustus 2010 18:27
> >> Aan: [email protected]; [email protected]
> >> Onderwerp: Re: [fw-general] Re: [zf-contributors] Poll: Should
> underscore
> >> prefixing of non-public elements be dropped?
> >>
> >> -- D. J. <[email protected]> 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: [email protected]
>
> *Origin: Happy Hacking!
>



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

Reply via email to