Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88774 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5938 invoked from network); 13 Oct 2015 13:37:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Oct 2015 13:37:24 -0000 X-Host-Fingerprint: 178.62.40.5 ajf.me Received: from [178.62.40.5] ([178.62.40.5:29471] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 91/00-05441-3190D165 for ; Tue, 13 Oct 2015 09:37:23 -0400 Message-ID: <91.00.05441.3190D165@pb1.pair.com> To: internals@lists.php.net References: <5C.21.16518.AA80C165@pb1.pair.com> Date: Tue, 13 Oct 2015 14:37:19 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:41.0) Gecko/20100101 Firefox/41.0 SeaMonkey/2.38 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 178.62.40.5 Subject: Re: [PHP-DEV] Scalar type hints and scalar type name aliases cause confuson From: ajf@ajf.me (Andrea Faulds) Hi, Peter Cowburn wrote: > On 13 October 2015 at 11:59, Andrea Faulds wrote: > >> Hi Peter, >> >> Peter Cowburn wrote: >> >> >> The manual uses them almost exclusively, >>> >> >> Not for type signatures it doesn't. It usually uses "int" and "bool". > > > I said "almost" for a reason. More clearly, we use the long names in prose > and by convention the short ones in the function prototypes. Oh, right. My bad. > > I would say that more confusion will arise from trying to use something > that comes naturally (e.g. "integer") and getting an error, than having it > "just work". > People might be slightly surprised it's not allowed, but it'd be very clear what was wrong with the code and how to fix it, so it's not really a problem. > > So what if there is more than one way to say "hey, I want an integer here", > particularly when they're super-duper common terms that are used > everywhere. (I'm talking about "boolean" and "integer" specifically, > however if someone wants to use "long", or "double", or "real" then why the > hell stop them? > They're not used in source code much, though. Thanks. -- Andrea Faulds http://ajf.me/