-
Notifications
You must be signed in to change notification settings - Fork 19
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
Fix BGR::new()
argument ordering for v0.9
#67
Comments
Certainly In contrast, The use of |
I feel like LSP-enabled IDE's should prevent this since they often show you the function parameter names as you are writing a call to the function.
I'm not sure I understood this bit. Do mean in contrast to
It's a good point, however, in my view a library has to take a stand at some point that users have to have a certain level of knowledge about the parameter ordering of the functions they are calling. The alternative side with only offering There are also those users who would instinctively reach for a |
|
Generally, the environment will be limited on readers side than writers side, for example some people will read them through
It won't be unnatural if
I agree that the developer should be sure what they are writing, but non-author of the project will have less knowledge at first as described above. It's not critical, but it would be good to make the code reading easier even for the first-time reader... as far as it does not lower the usability of this crate.
Totally true. I overlooked that since I usually use
Sounds reasonable. I just remembered that I got a build error on |
I felt the name of |
Another option is |
As a reader reading I guess it might be a slightly reduced probability but as a non-trusting reader of that code I'd still want to look up the docs. |
I don't see a way of avoiding such ambiguity for a multi-arg function call, without Rust adopting something like Swift's syntax, or maybe |
There is also the option of removing the function completely as that would completely remove ambiguity if users are forced to use On the other hand, this ambiguity is still technically an issue for |
I feel the asymmetry here can be acceptable, because it is sourced from widely-shared "r, g, b" convention. In that sense BGR is second-class citizen (actually this crate is About |
#32 discovered the unintuitive argument ordering for various
new()
functions such asBGR::new()
.These functions were then deprecated in
v0.8.16
, since forv0.9
we are allowed breaking changes I would like to fix this issue by re-ordering the function arguments to the intuitive ordering(b, g, r)
, and then un-deprecate them.The text was updated successfully, but these errors were encountered: