Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83913 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52896 invoked from network); 26 Feb 2015 18:49:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Feb 2015 18:49:18 -0000 Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.160.180 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.160.180 mail-yk0-f180.google.com Received: from [209.85.160.180] ([209.85.160.180:37013] helo=mail-yk0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D0/E9-32582-EAA6FE45 for ; Thu, 26 Feb 2015 13:49:18 -0500 Received: by ykq19 with SMTP id 19so4959989ykq.4 for ; Thu, 26 Feb 2015 10:49:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=5eRawuCnJ7ivbhDmGrkWi+7+mccWRTphkyuY+I9kwnk=; b=XglXXdoeyM5/gsE9zDx8Q3FxAeYF4ynwxgltJfqYIpCcAFzwnxEWBA7zkMIPGxMre3 +4r7ASjz7MEQgkaJX/6cIDiiWM9n4gjeTk+G4wMqvs7NN9Ri5RtUUEFxkDfUa6tjbo89 63pQ2FId99jcIieAZ/B5aTPkYMUcTIfxt5h6ggtCFspT/UdiWZNwq2xz091svm35GrV5 9fh2V5qkJ90tSLPSJqjSE1UskKAFFKdzM3vNe0tcFR3FWG9tqQ8ORtLjKaU0RCVbzUu0 lLqhOZTHCmhgnDGOYpldaIb0F9O5HZyZ/jTTi9goJim55/Ko8zF85RY4f4y0SE2mqcJq LE5w== X-Gm-Message-State: ALoCoQn7lexMT5LgtjBtmvDUblaCZFf9twUQg2oFbLVsu5nOZcRvMiQzg3g+FB5URVVAo653ODot MIME-Version: 1.0 X-Received: by 10.236.104.194 with SMTP id i42mr9377633yhg.89.1424976555617; Thu, 26 Feb 2015 10:49:15 -0800 (PST) Received: by 10.170.71.86 with HTTP; Thu, 26 Feb 2015 10:49:15 -0800 (PST) X-Originating-IP: [85.189.96.186] In-Reply-To: <3d639901ae85227b219e7ee59b3140fe@mail.gmail.com> References: <3d639901ae85227b219e7ee59b3140fe@mail.gmail.com> Date: Thu, 26 Feb 2015 18:49:15 +0000 Message-ID: To: Zeev Suraski Cc: Theodore Brown , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] A different user perspective on scalar type declarations From: danack@basereality.com (Dan Ackroyd) On 26 February 2015 at 17:48, Zeev Suraski wrote: >> From: Theodore Brown [mailto:theodorejb@outlook.com] >> 2. Strict types are important in some cases. >> >> I would *want* any value with the wrong type (even a string like > "26") >> to be flagged as an error when passed to a function expecting an > integer. > > > I agree completely; However, such use cases like this are a lot less > common than the situations where you do want sensible coercion to be > allowed. That's just not true on medium to large code bases, and if you think that's true it's possibly an explanation of why you don't see why people want strict types so much. In most applications, the part of the code that is exposed to the outside world and has to convert strings or unknown types into known types is a very small layer at the outside edge of the application. The vast majority of code written for non-trivial applications has no contact with the outside world. Instead it only communicates to other layers inside the application where the types required are fully known, and so the parameters passed should already be in the correct type. And so type coercion is at best unneeded, and usually not wanted. I can understand why people might only want to use weak types for their code base, but for you to continually dismiss people's desire for strict types after all this has been explained to you multiple times is very depressing. cheers Dan