Re: Common method names (was: "Re: [PEAR-DEV] HTML_Template_IT package release")
| From: | Markus Wolff | Date: | Sat, 31 Aug 2002 17:42:45 +0000 |
| Subject: | Re: Common method names (was: "Re: [PEAR-DEV] HTML_Template_IT package release") | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-8796@lists.php.net to get a copy of this message | ||
On Sat, 31 Aug 2002 19:01:09 +0300 (EEST)
Mika Tuupola <tuupola@appelsiini.net> wrote:
> > So I guess it wouldn´t be too bad to introduce something like this to
> > PEAR. Say, a common method "get()" for getting a string representation
>
> $foo->toString() ?
That´s the way .NET names this kind of methods. On the other hand, many
classes in PEAR already use get(), so making this the defacto standard
will cause the least trouble/work.
> I have been naming the methods getXxx() for getting the value and
> printXxx() for outputting the value. Although usually including
> the printXxx() methods is not necessary since you can allways
> use
>
> print $foo->getXxx().
Agreed, but some people are lazy, you know :-)
Regards,
Markus
--
Markus Wolff <wolff@21st.de>