Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87602 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43402 invoked from network); 4 Aug 2015 12:09:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2015 12:09:23 -0000 Authentication-Results: pb1.pair.com header.from=scott@paragonie.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=scott@paragonie.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain paragonie.com from 209.85.192.44 cause and error) X-PHP-List-Original-Sender: scott@paragonie.com X-Host-Fingerprint: 209.85.192.44 mail-qg0-f44.google.com Received: from [209.85.192.44] ([209.85.192.44:36209] helo=mail-qg0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0D/23-24673-27BA0C55 for ; Tue, 04 Aug 2015 08:09:23 -0400 Received: by qgeh16 with SMTP id h16so4331042qge.3 for ; Tue, 04 Aug 2015 05:09:20 -0700 (PDT) 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=1uGgbf/Z0Yfkf5Dvd/JB3MqNy+PJQOA/EqBONbjwLts=; b=mrQfZBnUCaWQfnvNEweviZvQPRciVEDQh+5aQxO3IKZzknRXsAi13jrNNcv8kdQsVY JLB2bENOrZugSIwk59JPzLRcx/0C2ZU0ZrLtWh8rdD9OCnJs+FOQSQOFFSTcdlayZTzw xZnSLK3k4OrsMr49jdlLEIsZU52K9lpdC8IZi+Vd13cpArwDl9ACYlxcs5JsV8LzJ8RA ihdGyPkOP8fmtk4ljspyUjoci2QWNr90AgivpEZ7yxBgZ9JK0DgB+UmTCP+iSruv9KeR 7ChYTGkd9Yra0HzjKfPy7aT4HkwXQm9wqK2fMO1eBBSy8a3KtM22GCr9WgRxCr8G9b7m U0gA== X-Gm-Message-State: ALoCoQmaPt9rvLDmTJrl803UkEEnMYN3Oz6BL57zgLLvEwL8rm1tOvtwxnKQuhQuHXmkJhDyLkTE MIME-Version: 1.0 X-Received: by 10.140.108.6 with SMTP id i6mr5702155qgf.73.1438690160257; Tue, 04 Aug 2015 05:09:20 -0700 (PDT) Received: by 10.96.83.102 with HTTP; Tue, 4 Aug 2015 05:09:20 -0700 (PDT) In-Reply-To: References: <9996b5784a1bfbca80b07de01f1a7a94@k-piste.dy.fi> Date: Tue, 4 Aug 2015 08:09:20 -0400 Message-ID: To: Peter Lind Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] PHP 7.1 Cryptography Projects From: scott@paragonie.com (Scott Arciszewski) On Tue, Aug 4, 2015 at 8:06 AM, Peter Lind wrote: > On 4 August 2015 at 13:56, Scott Arciszewski wrote: >> >> >> Hi Peter, >> >> It's not really a "made-up string format", in the sense that it has a >> precedent (PDO). >> > > True, and that format sucks royally. It trips people up. > > Combining several arguments into one string is bad design. If it was good > design, you'd see userland code using it all over the place. > > >> >> Hopefully my response to Lauri makes this design decision seem more >> reasonable. > > > No, quite the opposite. > > You're arguing that this: > > new \Namespace\Class(":cipher=AES-256;mode=GCM"); > > is easier to work with than: > > new \Namespace\Class(null, 'AES-256', 'GCM'); > > Or possibly > > $config = new \Namespace\ConfigClass(); > $config->setCipher('AES-256') > ->setMode('GCM'); > > $crypto = new \Namespace\Class($config); > > > Your parameter layout may be easier for you to deal with, but all the people > you're trying to help with this will be worse off for it. > PDOs constructor has only lead to more debugging, not better code (unlike > the rest of PDO). > > Regards > Peter > Hi Peter, I'm not particularly married to a particular constructor format. This is a good discussion to have. Scott Arciszewski Chief Development Officer Paragon Initiative Enterprises