[haiku-development] Re: Callback naming conventions

  • From: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Tue, 17 Jan 2017 04:47:43 +1300

On 17 January 2017 at 03:16, Dario Casalinuovo <b.vitruvio@xxxxxxxxx> wrote:

Hello,
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 :

class Output {
public:
void IsEnabled();
void Foo();
protected:
void PrepareToConnect();
}

will become :

class Output {
public:
void IsEnabled();
void Foo();
protected:
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.

I don't think this brings anything useful to the API. The BeAPI
documentation, which has specific sections on things like hooks, etc.,
I think is the right approach to this. One should be using
documentation to design derivative classes, rather than guessing based
on names of functions.

Other related posts: