Re: [CFV] how to mark protected items?

From: Date: Tue, 22 Jun 2004 19:18:34 +0000
Subject: Re: [CFV] how to mark protected items?
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-31102@lists.php.net to get a copy of this message
Daniel Convissor wrote:
Hi: On Tue, Jun 22, 2004 at 08:41:15PM +0200, Bertrand Mansion wrote:
At stage 2, you will notice that most of your variables will be protected. Then
you will think "Wow, that's a lot of underscores !". Then, in your subclasses,
you will start to ask yourself "Is this var protected or private, I can't remember".
That's exactly the point of having the underscore. It makes you think. And if you don't remember, it says, "go look at the declarations or documentation."
... but if you didn't have the '_' you would just know that the var was protected or public and hence your subclass was welcome to use it. I thought the point of the '_' was to communicate some information about the variable. What Bertrand is saying is that when you start writing PHP5 code you will realize that all your vars are protected or private (sure w/ very few exceptions) and hence you lose meaning when you use '_' for both private and protected. If the answer is always supposed to be "think!" then why are we discussing putting anything on the beginning of var names? Hans

« previous php.pear.dev (#31102) next »