Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82223 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41408 invoked from network); 9 Feb 2015 05:12:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2015 05:12:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=rdlowrey@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rdlowrey@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.176 as permitted sender) X-PHP-List-Original-Sender: rdlowrey@gmail.com X-Host-Fingerprint: 209.85.223.176 mail-ie0-f176.google.com Received: from [209.85.223.176] ([209.85.223.176:45863] helo=mail-ie0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A7/26-26926-CA148D45 for ; Mon, 09 Feb 2015 00:12:14 -0500 Received: by iecat20 with SMTP id at20so5501397iec.12 for ; Sun, 08 Feb 2015 21:12:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=XOdDhNMb49Ajvw3MrHqUnF6/G6Z/pvC7cLKLFRXddeM=; b=O67kryM0KPX7iXL2U0wplHzz8IogECRmx6v4rQhYLLNKD2WQ9GKT2DqH3tHapZRdCK r/VCdtZE0Iw29B94jHnzMPUmGcn92pyOUVaxK29OUyQnWJwG5Ez9lxrcddhI7puo6Oya ANmLmT+R/UJBey0y2ZSKX7TDye6BTUTYib4xol8jxdmwngW8KwHfwuYhSvQquNgC+81z R3P3x5sTbEIBVzF9Wm5JmlS6akNOIS83eosqhrJ8yQL/D4HqrpnSuzEF1pNHgcZEP0zb 7t1XN+FZ2bjTHmVvRGcPW/2mMG+dpCtyjBYOefvSNspiKb+VgWSxF73++cnJNZhn98ml vnIQ== MIME-Version: 1.0 X-Received: by 10.50.129.9 with SMTP id ns9mr14742005igb.24.1423458730318; Sun, 08 Feb 2015 21:12:10 -0800 (PST) Received: by 10.50.156.198 with HTTP; Sun, 8 Feb 2015 21:12:10 -0800 (PST) Date: Mon, 9 Feb 2015 00:12:10 -0500 Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7b343c9cf9205d050ea0cf54 Subject: Re: Design by Contract From: rdlowrey@gmail.com (Daniel Lowrey) --047d7b343c9cf9205d050ea0cf54 Content-Type: text/plain; charset=UTF-8 First, let me say that I have voted against the current scalar types RFC. Please do not let that color your evaluation of the rest of this message ... I want to go on record (for the n-th time) as being unhappy about any proposal that forces me to use php.ini. IMHO if it doesn't work with `$ php -n` then it's not a solution, it's a hack. Yes, I understand that opcodes can't be removed (perf, yay!) without knowing ahead of time from php.ini. But the opcode removal difficulty should not be understood as a "well we just have to do it this way," situation. Instead it ought to serve as a warning sign that this is not the right answer. Type checking is not a configuration-level issue; it is a language-level issue. Shoehorning it into the .ini file is just another band-aid on a broken arm. We tend to hold new proposals to the litmus test, "can this be effectively accomplished in userland already?" Well, yeah, in this case it really can. Making assertions optionally throw isn't some great advancement: // I can do this now if (!is_string($str) && DEBUG) throw new Exception("you bad coder bro"); // I'm all for brevity but does this really need an RFC? assert(is_string($str), "you bad coder bro"); That's a pretty insignificant, surface-level improvement. Mostly I just disagree with the assertion (see what I did there?) that this DbC RFC is remotely the same as what the scalar types RFC is trying to accomplish. And it certainly doesn't have universal support. --047d7b343c9cf9205d050ea0cf54--