Posted by Sanders Kaufman on 07/25/07 17:50
Toby A Inkster wrote:
> Sanders Kaufman wrote:
>
>> If I were to write a "reinit()" it would do exactly the same thing.
>
> You don't write a "reinit()" and do exactly the same thing in it. You
> rename your constructor to "reinit()" and then create a new, one-line
> constructor which just does "$this->reinit();".
That would result in TWO function calls, every time the object is
created - the semi-automatic one to the constructor, and then the
reninit() that's called BY the constructor.
That violates a core design principle - that it not use resources
unnecessarily.
[Back to original message]
|