W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2014

Re: [Custom]: Rename "createdCallback" to "created"

From: 河内 隆仁 <kochi@google.com>
Date: Mon, 6 Oct 2014 19:32:38 +0900
Message-ID: <CADP2=hoMEuMck+9aG5-PFx8tJ6+WntBZv=e__axgUBVhvVg7nw@mail.gmail.com>
To: Jarek Foksa <jarek@foksa.name>
Cc: public-webapps <public-webapps@w3.org>
Hi Jarek,

What I learned from people around me is that these names have "Callback"
suffixes because
- to indicate that it is for a callback function and not a callable API
- it is low-level API and had to use non-trivial name

So even it doesn't seem to add any information, the suffix has some meaning
by existing there.

I'm concerned about what you said about "inconsistent with the rest of the
Web Platform".
What are examples of the rest?

On Thu, Oct 2, 2014 at 3:09 AM, Jarek Foksa <jarek@foksa.name> wrote:

> Custom elements spec defines following lifycycle callbacks:
> - createdCallback()
> - attachedCallback()
> - detachedCallback()
> - attributeChangedCallback()
> I'm wondering what was the reasoning behind the naming convention used
> here, it feels verbose and inconsistent with the rest of the Web Platform.
> Even Polymer authors, which I thought were also contributing to the spec,
> decided to drop the "callback" postfix.
> The postfix doesn't add any additional information. If method name states
> what has happened (“created”, “attached”) rather than what should happen
> (“create”, “attach”) then it’s obvious that such method is a callback.

Takayoshi Kochi
Received on Monday, 6 October 2014 10:33:25 UTC

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