Re: tired of referencing static variables/constants with 'self ::'
| From: | Richard Lynch | Date: | Wed, 10 May 2006 04:45:17 +0000 |
| Subject: | Re: tired of referencing static variables/constants with 'self ::' | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-235846@lists.php.net to get a copy of this message | ||
On Tue, May 9, 2006 4:48 pm, D. Dante Lorenso wrote:
> If
> the search for my constant follows the search I've listed above, self
> would never be necessary unless you wanted to pinpoint "3" directly.
> Under this same line of thinking, though, '$this->' really shouldn't
> be
> be necessary either unless you wanted to clarify local vs this for
> same-named variables.
Languages that let you get away without specifying $this-> and self::
do exist...
But, in my experience, after a certain level of complexity is
achieved, you end up getting very confused very fast about where $foo
is coming from...
And it turns into a real nightmare when you inherit somebody else's code:
100,000 lines of code here
echo $foo;
100,000 lines of code here
You really have no idea where $foo came from, do you? :-)
So I personally PREFER that one has to make it clear where the
variables are coming from.
--
Like Music?
http://l-i-e.com/artists.htm