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

> 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