G
Guest
eg.
enum ButtonPress{Start, Stop, Pause};
void OnButtonPress(ButtonPress buttonPress) // <--- repetetive signature
It looks a bit ugly, and I know some programmers who would go ballistic at
the sight of this, but, in my experience, each of the three repetitions is
justified in itself, and overall, life is smoother if we just type it out,
and keep going without worrying about it.
btw. at the other end of the spectrum is the programmer who uses extreme
overloading. His approach would be...
void on(ButtonPress item);
enum ButtonPress{Start, Stop, Pause};
void OnButtonPress(ButtonPress buttonPress) // <--- repetetive signature
It looks a bit ugly, and I know some programmers who would go ballistic at
the sight of this, but, in my experience, each of the three repetitions is
justified in itself, and overall, life is smoother if we just type it out,
and keep going without worrying about it.
btw. at the other end of the spectrum is the programmer who uses extreme
overloading. His approach would be...
void on(ButtonPress item);