Uh oh!
There was an error while loading. Please reload this page.
Revert "std: Standardize (input, output) param orderings" - #24142
Revert "std: Standardize (input, output) param orderings"#24142pcwalton wants to merge 1 commit into
Conversation
This reverts commit acd48a2.
emberian
commented
Apr 7, 2015
I agree completely, and think this warrants releasing a beta update. |
emberian
commented
Apr 7, 2015
Though, eternaleye brings up in IRC:
|
pythonesque
commented
Apr 7, 2015
Agreed with the first two comments. |
pcwalton
commented
Apr 7, 2015
Sure, but I think we should make it consistent the other way: destination, then source. |
eternaleye
commented
Apr 7, 2015
@pcwalton On the one hand, there are a number of places we already have destination-like stuff on the left, the biggest being 'let' and assignment in general, followed by clone_from. On the other hand, Rust code is read left-to-right; inside of a function's arguments, it feels natural to me that data will flow in the same direction as the reader's attention. Similarly, when putting the returned data in the return type is infeasible, the end of the argument list is the "nearest" position visually. |
CloudiDust
commented
Apr 7, 2015
@eternaleye, I see So IMHO the original behaviour before the slient breaking change is fine. However this is (unfortunately) a result of inconsistent precedents. If we can truly start anew, we should consistently do |
CloudiDust
commented
Apr 7, 2015
That said, such inconsistency is still a problem and I can see why people would prefer breaking from the C convention. So maybe we can use a "painfully clear" name that indicates the direction, like |
petrochenkov
commented
Apr 7, 2015
So, after one silent breakage people fixed their code in accordance with the new parameter ordering and now you are going to break it again. |
CloudiDust
commented
Apr 7, 2015
I'll publish an RFC about renaming the functions, along the line of Currently I am of the opinion that reverting may actually add to the confusion. |
adrientetar
commented
Apr 7, 2015
Now that it's done, I say we should keep it and deal with it. It the long run this ordering makes more sense and only a new language can afford to commit such changes. |
vladimir-lu-work
commented
Apr 7, 2015
-1 to merging this pull request. For what it's worth I think it is better to stay consistent within Rust, and if that means a break for applications because of reversed argument order then so be it. It would be very helpful to have a lint that warns about mut -> const conversion. |
Tobba
commented
Apr 7, 2015
-1 |
CloudiDust
commented
Apr 7, 2015
On second thought, the five affected functions: can be said to have names different enough from their C counterparts. (YMMV of course, as this is a case where we can argue either way.) (Also, if we rename them to So maybe renaming won't be a worthy improvement, as long as people are aware of Rust's rule: |
liigo
commented
Apr 7, 2015
via email
-1
keep consistent in rust is more important than in c. Please stop doing this
change even without any reason. |
liigo
commented
Apr 7, 2015
I mean, please explain why you change it, in git commit message at least.
|
bfops
commented
Apr 7, 2015
Maybe this is the worst of both worlds, but what if the That said, it would really only make sense if |
lpar
commented
Apr 7, 2015
I'm not a Rust user yet, but as someone considering the language for future projects who has written C recently, I would much rather have Rust be consistent itself, than slavishly copy whatever choices C has made over the years. |
aturon
commented
Apr 7, 2015
Cross-posted from reddit: It was absolutely a mistake to push the ordering change through without an RFC, and I apologize for signing off on it. It wound up causing some painful fallout, and it's clear that many have strong opinions about the order here that weren't taken into account. Of course, this kind of thing won't happen in the future, since we won't be able to make changes to stable APIs. The main question now is whether, and how, we should reverse this change. I'm going to suggest that discussion on the next step happen in the ongoing discuss thread, where there are already a number of interesting suggestions. Let's try to reach a consensus there before taking action. As such, I'm going to close this PR for now, to try to move discussion to a central place and come to a decision before taking an action like this one. |
I don't know if I agree that this needed an RFC, but this was definitely the wrong call IMHO. I think it's bad enough that it should be a beta-period breaking change.
This reverts commit acd48a2.
r? @aturon