Hi Stas:
On Tue, Jan 19, 2010 at 12:09:53PM -0800, Stanislav Malyshev wrote:
>
> $oop = $eep->oop();
> $ork = $oop->ork();
> $ah = $ork->ah();
> $ah2 = $ah->ah();
>
> where it instantly becomes crystal clear!
:) Yep, that's lousy code.
Variables should be named for the classes they represent.
$eep = new eep;
$eep->oop();
$decorator = $eep->ork();
$decorator->ah();
$decorator->ah();
// Output, of course, is "I love you".
// What do you mean you've never seen The Jetsons?!
Now it's clear that oop() is a method of eep while ork returns a
decorator object that contains the ah() method. No guess work involved.
If everything is chained, it's a pain to figure out such basic workings.
I'll leave it at this.
Thanks,
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php