let a = f64::min(foo(), bar()); let b = f64::min(foo(), bar());
Here, the meaning is extremely clear. Take the minimum (or maximum) of the value returned by
However, when using the postfix notation, I find it much harder to read:
let value = foo() .min(bar()) .max(baz());
Instinctively, I try to read it as:
foo(). The value will then be at minimum the value of
bar(), and at maximum the value of
If this seems right, re-read it, it's completely backward. The maximum is the value of
bar() and the minimum is the value of
Am I the only one in this case?
This is very minor, so I don't feel that it would be justify to introduce two new functions
at_least(). I'm relatively sure that such change is breaking, so it could only be done at an edition barrier (which increase the bar even more). But I still think it would make the code much less prone to be miss-read.
let value = foo() .at_most(bar()) .at_least(baz());