On 4 August 2015 at 13:56, Scott Arciszewski <sc...@paragonie.com> 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

Reply via email to