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

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

From: Jarek Foksa <jarek@foksa.name>
Date: Mon, 6 Oct 2014 17:08:46 +0200
Cc: public-webapps <public-webapps@w3.org>
Message-Id: <4F4E693C-F8EC-44F6-B2B5-80E712338038@foksa.name>
To: "Takayoshi Kochi (河内 隆仁)" <kochi@google.com>

> On 2014-10-06, at 12:32, Takayoshi Kochi (河内 隆仁) <kochi@google.com> wrote:
> 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.

Every API, no matter whether low or high level, should use descriptive and semantic names.

I don't think it's a good idea to change the semantics of the word "callback" when used in context of a custom element. The term "callback" does not mean "a function that is not a callable API".

Maybe the term "delegate" would be more semantic here? Another idea is to use “host” postfix (e.g. createdHost) which at least provides some additional information instead of repeating obvious fact.

> On 2014-10-06, at 12:32, Takayoshi Kochi (河内 隆仁) <kochi@google.com> wrote:
> I'm concerned about what you said about "inconsistent with the rest of the Web Platform". What are examples of the rest?

I meant the on<eventname> naming convention used by DOM event callbacks (e.g. onclick, onfocus). After having though about it second time, this convention is really obscure and it's probably not worth following unless lifcycle events will be supported in future.
Received on Monday, 6 October 2014 15:09:09 UTC

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