Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65315 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41804 invoked from network); 29 Jan 2013 05:46:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2013 05:46:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.163 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.163 smtp163.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.163] ([67.192.241.163:35537] helo=smtp163.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/53-28517-73267015 for ; Tue, 29 Jan 2013 00:46:32 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp6.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 64F5F3B81D7; Tue, 29 Jan 2013 00:46:28 -0500 (EST) X-Virus-Scanned: OK Received: by smtp6.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id EF6F42704AF; Tue, 29 Jan 2013 00:46:27 -0500 (EST) Message-ID: <51076233.2040507@sugarcrm.com> Date: Mon, 28 Jan 2013 21:46:27 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Alan Knowles CC: PHP Internals References: <1460659e-237d-4c7c-8cfa-523ec857d646@email.android.com> <51074873.5090600@roojs.com> In-Reply-To: <51074873.5090600@roojs.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [VOTE] Deprecate and remove calls from incompatible context (example of real usage that will break) From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > I've used this in other places, it's basically lightweight traits, and > has always been perfectly valid code. There does not seem to be a clear > justification for deprecating it other than, It's not the way 'some' > people like code to work... Well, I think the reason is that this code is unsafe and goes against the principles of OO. I understand that there's a tendency to use OO as a neat way to namespace global functions and autoload them, but that's not how it is supposed to work. If addPreserveText() uses anything from Footer, it should not be called from TextRun, but if it does not, it should be in Section. I certainly disagree that the code that calls method of Footer from TextRun is "easy to follow" - I'd be very surprised seeing such code and would immediately think it's some kind of bad copy-paste from one class to another. I understand that this hack works for you - but language usually enforce some rules of what you can and can not do, according to some guiding principles. Having this hack goes again those principles. As far as I know, no OO languages allow to do such things. I note that we have people here constantly criticizing us for not changing the names of all functions in order to satisfy their esthetic sense, but once we change something that obviously for nearly everybody (see vote) shouldn't even be there and never was intended to work this way - we get criticized again for breaking stuff :) -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227