-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rename maybeStartOrStopPolling to pollIfAnyControllersOpen #4533
Conversation
Naming a method "maybe..." is not an issue with the name per se but rather the design of the class (big fat IMO). The proposed renaming just leaks implementation details. |
There is a lot more work to do on #3641 which is really difficult. As we agreed months ago, we are not focusing on the controller system rewrite for now in order to focus on more pressing issues. |
If I look on the name maybeStartOrStopPolling alone, I've no clue, what this function does. While the new name is understandable to me without reading the code. |
I agree. However, it's also true that the new name leaks implementation details. And it's inconsistent with other parts of the codebase where we use used th3 |
|
I agree that the |
The following remarks are out of scope of this PR! Just some thoughts to give you an idea how to improve the design. Ideally, the function should return an The function name could simply reflect the purpose, e.g. The current polling state can be derived from the state of the internal timer, i.e. it is either States and state changes should be modeled explicitly from my experience. |
This is just a trivial name change and it seems that the change overall is welcomed, so lets just merge. Objections? |
The new name is a slight improvement. A better name might evolve when refactoring this code. LGTM |
Cherry-picking a small change from #3641 to clean up the code smell of naming symbols with "maybe".