W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2013

Re: APIs that have boolean arguments defaulting to true

From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Mon, 11 Nov 2013 13:15:20 -0800
Message-ID: <CABZUbM1eXLt73Y3-jWSz56-SrSiw7FzH5C5wMcJfyjmH02i8yQ@mail.gmail.com>
To: Domenic Denicola <domenic@domenicdenicola.com>
Cc: "Mark S. Miller" <erights@google.com>, Boris Zbarsky <bzbarsky@mit.edu>, "public-script-coord@w3.org" <public-script-coord@w3.org>
On Mon, Nov 11, 2013 at 12:18 PM, Domenic Denicola <
domenic@domenicdenicola.com> wrote:

> My impression was that boolean arguments in general should be avoided.
> "The Boolean Trap", as it's called:
>
> ACK.
Boolean arguments indicated that the function does more than one thing.
They are also confusing.

In OOD, it violates method-SRP (MSRP?) (if such abstract OOD esoteria
matters to anyone else).

<greenfield>
 Instead, a second method.
 clone(),
 cloneDeep();
</greenfield>
-- 
Garrett
@xkit
ChordCycles.com
Received on Monday, 11 November 2013 21:15:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:19 UTC