[whatwg/url] isSpecial vs. isNotSpecial in host parser algorithm (#399)

Commit ac532aeaf418caaa996ed05636b752f2caf118e1 introduced a change to the host parser algorithm that made optional the parameter about whether the domain was special, so that HTML could call it under the assumption that a URL was special unless otherwise noted.

However, in making this change, the meaning of the parameter was also inverted, such that `isSpecial` became `isNotSpecial` and thus the default became `false`.

I question this change, because it means that explicitly saying that a URL is special means that you essentially have to use a double negative, which can be confusing: `isNotSpecial = false`.

@annevk defended this decision by pointing to [TAG Design Principles](https://w3ctag.github.io/design-principles/#prefer-dict-to-bool).

However, I have three counterpoints:

1. The same section supports my argument against using double negatives, and notes that an appropriate balance needs to be struck.
2. The reasoning behind not defaulting to true seems to be one related specifically to JavaScript, and it's not clear to me that this is a JavaScript-exposed algorithm which would require that consideration.
3. An implementation would have to change both its code and its tests at the same time in order to account for this inversion of the parameter. (I acknowledge that this is probably less important of a consideration.)

@annevk @domenic What are your thoughts?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/399

Received on Wednesday, 27 June 2018 02:53:31 UTC