Re: [RFC] Named arguments
| From: | Mike Schinkel | Date: | Tue, 05 May 2020 18:43:21 +0000 |
| Subject: | Re: [RFC] Named arguments | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-110021@lists.php.net to get a copy of this message | ||
On May 5, 2020, at 2:33 PM, Marco Pivetta <ocramius@gmail.com> wrote:
>
> On Tue, May 5, 2020 at 8:22 PM Nikita Popov <nikita.ppv@gmail.com> wrote:
>
>> subprocess.run(args, *, stdin=None, input=None, stdout=None,
>> stderr=None, capture_output=False, shell=False, cwd=None, timeout=None,
>> check=False, encoding=None, errors=None, text=None, env=None,
>> universal_newlines=None)
>>
>> ... and show that to a PHP developer, they're probably going to tell me
>> that this is horrible API design. They would, of course, be wrong. It's
>> reasonable API design, just in a language that supports named arguments.
>>
>
> There are so many ways in which the above fails in different ways (besed on
> flags) that I can't even start to reason about the resulting chaos.
That looks like a perfect use-case for table-based unit-testing.
> Would rather consume a dozen of differently named (curried) versions of
> this.
And I would rather have one function/method with many parameters than many many different named
functions/methods. Easier to learn, easier to remember, and easier to define a standard for
function/method naming.
Different strokes, different folks. #fwiw
-Mike