[haiku-development] Re: Callback naming conventions

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 16 Jan 2017 15:44:23 +0100

Am 16/01/2017 um 15:16 schrieb Dario Casalinuovo:

my desire for new API would be to set a style convention for callbacks
names. I think it will improve code readability by making obvious which
methods are supposed to be implemented.

I actually like the OnSomething style used widely in other APIs.
Speaking in code :

void PrepareToConnect();
will become :
void OnPrepareToConnect();

Is there any comment on that? Other proposals? +1/-1?
It'd be useful to begin defining where the API is supposed to evolve.

It should become OnConnect() instead, but we already have a style for this given the hooks that are used pretty much everywhere (MouseMoved(), MessageReceived(), ...) -- why deviate from that?

Bye,
   Axel.


Other related posts: