Design principles: no bool arguments

Thomas 'PointedEars' Lahn PointedEars at web.de
Thu Aug 25 22:10:06 CEST 2011


Stefan Behnel wrote:

> Thomas 'PointedEars' Lahn, 25.08.2011 11:29:
>> Stefan Behnel wrote:
>>> It's totally unreadable to find this in the code:
>>>
>>>       data1.merge_with(data2, true);
>>>
>>> Requires you to either a) know the underlying signature by heart, or b)
>>> look it up before understanding the code.
>>>
>>> It's a lot harder to argue against this:
>>>
>>>       data1.merge_with(data2, overwrite_duplicates=True)
>>[...]
>> And you will still have to know the underlying signature to name the
>> argument.  Worse, with keyword arguments you *have to* look up the
>> documentation (i. e., it needs to be well-documented as well) to know its
>> name (as the compiler can only tell you "kwargs").
> 
> Note that code is read more often than it gets written.

It is not clear to me why you completely ignored the rest of my
counter-argument.  As it is, yours is a weak argument.

-- 
PointedEars

Bitte keine Kopien per E-Mail. / Please do not Cc: me.



More information about the Python-list mailing list