Re: Coding standards
| From: | Stig S. Bakken | Date: | Sat, 21 Jul 2001 21:54:54 +0000 |
| Subject: | Re: Coding standards | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-934@lists.php.net to get a copy of this message | ||
Mika Tuupola wrote:
>
> On Wed, 18 Jul 2001, Erik Hjortsberg wrote:
>
> > I think it should be applied to variables too:
> > var $_foo;
> >
> > Unlawfully changing a private variable is often more dangerous than
> > calling a private method as the error won't be notices as easily.
>
> I agree using _ in front of private variable is a good idea.
> Still, a class should have set*() methods for modifying variables.
> So if youre modifying them directly you allready are intentionally
> doing something risky anyway.
We can advise people to use set methods, but it should not be a
requirement for being "pearified". We have to draw the line somewhere
or we all need to start carrying restraints.
- Stig