Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71335 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8072 invoked from network); 20 Jan 2014 19:20:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jan 2014 19:20:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 198.187.29.233 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 198.187.29.233 imap1.ox.registrar-servers.com Received: from [198.187.29.233] ([198.187.29.233:40640] helo=imap1.ox.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/74-02192-7077DD25 for ; Mon, 20 Jan 2014 14:20:40 -0500 Received: from localhost (localhost [127.0.0.1]) by oxmail.registrar-servers.com (Postfix) with ESMTP id 2C10C200089; Mon, 20 Jan 2014 14:20:36 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap1.ox.registrar-servers.com Received: from oxmail.registrar-servers.com ([127.0.0.1]) by localhost (imap1.ox.registrar-servers.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id chLrICgj5IYc; Mon, 20 Jan 2014 14:20:36 -0500 (EST) Received: from [192.168.0.200] (unknown [176.25.177.94]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id 14757200057; Mon, 20 Jan 2014 14:20:33 -0500 (EST) Message-ID: <52DD76FF.7080700@ajf.me> Date: Mon, 20 Jan 2014 19:20:31 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Philip Sturgeon , Robert Stoll CC: Joe Watkins , "internals@lists.php.net" References: <52D71748.1090402@googlemail.com> <52D71FAE.8030002@ajf.me> <005001cf124f$3a40df00$aec29d00$@tutteli.ch> <20140116110127.202079vzjsj76n7b@webmail.tutteli.ch> <0B.B1.24763.139B7D25@pb1.pair.com> <002001cf12da$2bfbda90$83f38fb0$@tutteli.ch> <52DCA3E7.80602@lerdorf.com> <52DCED71.3020207@pthreads.org> <006301cf15f5$22f8df60$68ea9e20$@tutteli.ch> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Introducing "Array Of" RFC From: ajf@ajf.me (Andrea Faulds) On 20/01/14 18:43, Philip Sturgeon wrote: > Syntax > --------- > > There have been a lot of people suggesting various types of syntax. As > Joe said, using generics syntax for not generics would be a travesty, > and an overcomplication of what should be a simple feature. Using generics-like syntax is more consistent with what we have already, though. Having "Array" for an array yet "Bar[]" for an Array of bar is confusing, especially since you'd then also logically have "Array[]". Why? Using the generics syntax does not require adding generics. It simply allows a better syntax which is consistent with the existing syntax. I'd much rather have "Array", "Array" and "Array" here than "Array", "Bar[]" and "Array[]". It's also compatible with HHVM, which is a plus. I don't agree that this would be "an overcomplication of what should be a simple feature.". It would not at all. This syntax is simpler, more consistent and more logical than that originally proposed. > For those who hate OOP, array of would be a lovely way to ask for an > array of callables. Trying to make generics happen is a great way to > force not only new syntax, but a brand new OOP paradigm that will be > new for EVERYONE, so ignoring that syntax and letting our functional > and OOP folks have a nice thing shouldn't be considered a negative. Again, generics-esque syntax doesn't mean adding generics. It also means that, if generics were added in future, we could use generics here - and they'd implement the same functionality in a better way. :) > This is something I hope we can all agree on. It is by no means > confusing, but I would be happy to run a poll and get NetTuts to tweet > it, to see if the average user is confused by this syntax. I've > tweeted about it and had 1 out of 50ish replies saying they weren't > sure. The confusion of 2% is something that can easily be fixed with > documentation and time. > > Again, I'll be blogging about 5.6 features on NetTuts so those same > beginner level users will know all about it, and our documentation > will explain it for everyone else, meaning a 2% sub-section of users > will be EASY to fix. Why should we use a poll of some random tutorial site? This is a developer mailing list! -- Andrea Faulds http://ajf.me/