W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2015

Re: [whatwg] Confusion about node1.replace(node2)

From: Glen Huang <curvedmark@gmail.com>
Date: Sat, 10 Jan 2015 17:56:37 +0800
Message-Id: <50C4C9E7-D27B-4677-B290-16C4E6139810@gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: WHATWG <whatwg@whatwg.org>
> And since methods operate on the object they are invoked upon I think the name is clear
> enough.

The fact replace() is a method operating on an object doesn’t clarify the intention in this case,because the confusion here is that it’s unclear whether the object is having others take its place, or is itself trying take others’ place, and from the general meaning of the english word “replace”, it actually implies the latter.

> The general preference is brevity over precision.

In most cases, I favor brevity too, but when it starts to raise confusion, especially it’s implying the opposite of what it’s actually trying to do, brevity should no longer be a priority, IMHO.
Received on Saturday, 10 January 2015 09:57:05 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:32 UTC