Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46827 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21808 invoked from network); 19 Jan 2010 19:32:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jan 2010 19:32:10 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.185 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.185 il-mr1.zend.com Received: from [212.25.124.185] ([212.25.124.185:51628] helo=il-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BC/B2-29385-6B8065B4 for ; Tue, 19 Jan 2010 14:32:09 -0500 Received: from us-gw1.zend.com (unknown [192.168.16.5]) by il-mr1.zend.com (Postfix) with ESMTP id 95C2E504FF; Tue, 19 Jan 2010 21:15:47 +0200 (IST) Received: from [192.168.16.93] ([192.168.16.93]) by us-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 19 Jan 2010 11:32:01 -0800 Message-ID: <4B5608B2.8050308@zend.com> Date: Tue, 19 Jan 2010 11:32:02 -0800 Organization: Zend Technologies User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091204 Lightning/1.0b2pre Thunderbird/3.0 MIME-Version: 1.0 To: Daniel Convissor CC: PHP Internals List References: <4B54FC87.8070106@zend.com> <4B55EE56.8040104@lerdorf.com> <4B55FA44.1060601@zend.com> <20100119190836.GA17124@panix.com> In-Reply-To: <20100119190836.GA17124@panix.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 19 Jan 2010 19:32:01.0583 (UTC) FILETIME=[12CB83F0:01CA993E] Subject: Re: [PHP-DEV] function call chaining From: stas@zend.com (Stanislav Malyshev) Hi! > Sure. But one needs to understand the language. Otherwise the reader > needs to go hunting around a dictionary (or in our case, the source code) > to figure out what the heck the person (code) is trying to say (do). > > Chaining produces code that is not self-documenting. If you don't understand the language, nothing is self-documenting. If you have the basics, you'd be able to understand that if foo()+1 means "take result of foo() and add one", then foo()() would be "take result of foo() and call it as a function". Adding temp var would be just like writing $number = foo(); $number_plus_one = $number+1; - excessive verbosity with no added value. It's like writing comments in style of: foo(); // call foo() - surely it's documented, but not useful in any way. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com