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

[Bug 23532] Dealing with undefined

From: <bugzilla@jessica.w3.org>
Date: Wed, 23 Oct 2013 21:36:07 +0000
To: public-script-coord@w3.org
Message-ID: <bug-23532-3890-93IsVUJv9F@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=23532

--- Comment #24 from James Graham <james@hoppipolla.co.uk> ---
I am extremely skeptical of any claim that, given a function domFoo that takes
a single non-optional, argument, js programmers benefit more from consistency
between domFoo() and domFoo(undefined) than they do from throwing when the
argument is missing. It seems far more likely to me that users missing
non-optional arguments have made a mistake than that they are deliberately
trying to invoke the effect of passing undefined, not least because the effect
of passing undefined itself is often rather useless, and leads to a bad result
(NaN, "undefined", null, etc.) which then propagates through the rest of the
code making it extremely difficult to locate the original source of the bug.

Unless anyone has any concrete evidence that my suppositions above are
incorrect, I oppose removing throwing behavior from legacy APIs and suggest
throwing in both cases in future APIs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Wednesday, 23 October 2013 21:36:09 UTC

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