Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50673 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2446 invoked from network); 28 Nov 2010 21:09:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Nov 2010 21:09:24 -0000 Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 76.96.27.227 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 76.96.27.227 qmta12.emeryville.ca.mail.comcast.net Received: from [76.96.27.227] ([76.96.27.227:52228] helo=qmta12.emeryville.ca.mail.comcast.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/32-18134-305C2FC4 for ; Sun, 28 Nov 2010 16:09:24 -0500 Received: from omta10.emeryville.ca.mail.comcast.net ([76.96.30.28]) by qmta12.emeryville.ca.mail.comcast.net with comcast id ckZ01f0040cQ2SLACl9LzS; Sun, 28 Nov 2010 21:09:20 +0000 Received: from earth.ufp ([98.220.236.211]) by omta10.emeryville.ca.mail.comcast.net with comcast id cl961f00L4aLjBW8Wl9Az8; Sun, 28 Nov 2010 21:09:17 +0000 Received: from localhost (localhost [127.0.0.1]) by earth.ufp (Postfix) with ESMTP id D677DD7A51 for ; Sun, 28 Nov 2010 15:09:04 -0600 (CST) Received: from earth.ufp ([127.0.0.1]) by localhost (earth.ufp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lVx+vBJotpGh for ; Sun, 28 Nov 2010 15:09:04 -0600 (CST) Received: from linux-nkec.site (unknown [192.168.42.1]) by earth.ufp (Postfix) with ESMTPSA id BDAA7D79DA for ; Sun, 28 Nov 2010 15:09:04 -0600 (CST) To: internals@lists.php.net Date: Sun, 28 Nov 2010 15:09:50 -0600 User-Agent: KMail/1.13.5 (Linux/2.6.34.7-0.5-desktop; KDE/4.4.4; x86_64; ; ) References: <1290879624.7033.826.camel@guybrush> <4CF28CFC.2060204@gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-ID: <201011281509.50868.larry@garfieldtech.com> Subject: Re: [PHP-DEV] RFC: Making T_FUNCTION optional in method declarations From: larry@garfieldtech.com (Larry Garfield) On Sunday, November 28, 2010 11:24:02 am Dallas Gutauckis wrote: > I understand the concern from above, but I don't agree with it > fundamentally. The kind of practice suggested by this search mechanic tells > me that either there is lack of or little documentation, and lack of or > little understanding of the codebase in which the code resides thereby > making this argument flawed based solely on the assumption that the > majority of code is (or should be) poorly maintained/documented. > > Below is simply bad programming practice in many ways. No validation of > type (neither through type-hinting nor an instanceof check) is done, which > is why the code is so difficult to trace back. Presumably, you'd also have > some form of documentation (PHPDoc, anyone?) that would facilitate the > search for the declaration of that function. Again, that assumes a better > programming practice than is being provided as the example below. One > would hope that someone excluding their function keyword would also be "up > to date" enough to be validating objects. > > > function baz( $param ) { > > > > $param->morlocks(); > > > > } I would like to know how to get to the fantasy world you describe in which all developers are doing careful type checking and proper DocBlocks on everything. It sounds like it would be a glorious place to live, if only it could exist. (I routinely beat people over the head about that in a project with very good documentation standards, and we still have extremely good developers writing code that fails both of the above.) --Larry Garfield