Reply to Re: Static method vs Non Static method

Your name:

Reply:


Posted by Oli Filth on 05/26/06 19:41

Chung Leong said the following on 26/05/2006 17:05:
> gg9h0st wrote:
>> i really wander what makes static method special?
>
> Nothing. It's mainly for documentation purpose. I mean, you don't
> really need to declare class variable either. IIRC static methods will
> show up in a separate section when class info is retrieved through the
> reflection API.
>
> Often times in PHP you can do funky things simply because it's not
> worth the effort to stop funk.

If I understand your allusion correctly, in some ways, I'd say it's the
other way round. PHP lets you do a lot of unfunky things because the
developers didn't like the idea of being seen to enforce "funkiness" on
those uninitiated in the ways of funkiness, even though disciplined
funkiness would have been for their own good! IMO, the
static/non-static confusion and ability to add object variables
willy-nilly are two perfect examples of this in PHP.


Static members mean a lot more than that just a neat way of accessing
them separately via reflection, it's just that PHP has managed to
confuse the issue by letting the programmer do weird things for no good
reason. "Stricter" OO languages such as C++, Java, and C# that have the
concept of static members enforce them as such (being compiled
languages, they have to, obviously), and so they become a useful
"semantic" design tool, in the same way that inheritance, "abstract",
"final" and visibility specifiers are all useful, but completely
unnecessary in terms of program functionality.


--
Oli

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация