flame icon indicating copy to clipboard operation
flame copied to clipboard

Timer and TimerComponent APIs are inconsistent

Open luanpotter opened this issue 1 year ago • 4 comments

Taking a look at Timer and TimerComponent, I realized they have a different nomenclature on their APIs:

On TimerComponent, the length/duration of the timer is called period and it is a named parameter. That is a good name for when repeat is true.

But on the underlying Timer implementation, it is actually called limit and it is not a named parameter. That name feels better for non-repeating timers.

-> I do not have a strong preference for the parameter name, but I think it should be consistent. -> I think whether it is named-parameter or not should also be consistent - but I do tend to prefer the named-parameter on this matter, as it is more readable from the call site.

Thoughts? I can happily update one or the other depending on everyone's preferences. It is a breaking change, but I think keeping them consistent is very important to keep simplicity and avoid confusion for our users (for example when changing code from one to the other).

luanpotter avatar Mar 06 '23 03:03 luanpotter