Re: Common method names part 2
| From: | Alan Knowles | Date: | Fri, 20 Sep 2002 00:00:57 +0000 |
| Subject: | Re: Common method names part 2 | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-9238@lists.php.net to get a copy of this message | ||
Something I've been doing recently is prefixing any methods that are (or expect) to be called statically with 'static', eg. object::staticGet(), object::staticAutoLoad().. staticStart()
if that where the case, staticCreate(), would be a useable constructor...
Not sure what the feelings are about that becoming a recommendation - I do think we have enough solid standards at present, amd what we are now looking towards is, good code follows the rules, excellent code follows the guidelines as well......
anyway 2c for the morning..
Regards
Alan
Mika Tuupola wrote:
On Thu, 19 Sep 2002, Markus Wolff wrote:create() is quite logical since it creates and returns an instance of the class and init() is more of initialization of variables etc. If theres gonna be a (proposed) standard i'd vote for create() too.Other possibilities: init(), constructor(), ...I always use Class::Create(), and I often use init() for other things. I´ll accept any of the above, but wouldn´t like to use init(), as I´d have to rewrite some stuff :-)