-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
Add non-short-circuiting run conditions and re-rename short-circuiting run conditions to be explicit #13793
Comments
@JoJoJet, spinning this out into an issue. We should resolve this one way or another for 0.15. I definitely agree with your concern, I just don't think that the names are a good way to communicate this :) |
IMO that's the name having its intended effect. The problem is people not answering with the actual reason. The name is supposed to make you go 'huh that's weird, I wonder why it's named like that' so you go looking. If there's a simple name then it's really not clear that there's a huge asterisk when it comes to the system's heavior |
I would argue that most are using the combinators to just achieve some logical output, that is without taking advantage of the short-circuiting behavior - but maybe there is a better solution here: Maybe refactor interface to be:
This has the following advantages:
Disadvantages:
|
For context, the short circuiting is actually mostly a performance optimization, rather than a deliberate behavioral choice. |
Right - that's exactly what I thought. I imagine @JoJoJet 's concern is that perhaps there are users who deliberately want to take advantage of the behavior, and have it not be ambiguous. |
If we end up introducing non-short-circuiting variants, I think those should be the ones to get the longer name, as they're generally going to be dispreferred. Shortcircuiting is a real footgun, but it's rarely stumbled on. After seeing how run conditions are used in practice, most conditions don't use change detection or event readers, which are the main worry. We could add docs to the built in combinators that do as well to help warn users? |
I really don't agree with this. Non short-circuiting should get the shorter name since it's more reliable and generally has fewer considerations. In general, I believe any option that is faster but requires you to know what you're doing should get a longer, more descriptive name |
Hmm, fair. Let me bikeshed some names. If we add non-shortcircuiting nicely named variants I think I'm on board. Candidates:
I think |
I think |
While that's an important fact about how these work, I don't think this naming convention was doing a good job conveying this information to users. As evidenced by the fact that users regularly asked "why is it called
and_then
", and answerers didn't point to "oh that's because it's short-circuiting".IMO we should use clear, simple names, and explain this behavior better in documentation and other learning material.
Originally posted by @alice-i-cecile in #13784 (comment)
The text was updated successfully, but these errors were encountered: