It's a bit strange to define an "exceeds" function that way. It doesn't read well. "Greater than" is a synonym of exceeds. For exceeds(x, threshold), I'd expect to see "x > threshold"; i.e., x exceeds threshold.
I don't think the problem is the use of the operator, but rather its use is hidden; i.e., there isn't an explicit contract. Concepts would alleviate the issue.
No, those two expressions are definitely not the same. The result of evaluating both expressions is the same though. Maybe that's what you meant to say.
The result it the same for sure, but taking into account the rules of how < and > work (they have an inverse relation) its is not so wrong to say that
a < b
is equal to
b > a
I know what you are trying to say. It is easier (more human) to read one form than it is the other. That however does not change that the expression is the same.
4
u/one-oh Aug 08 '14
It's a bit strange to define an "exceeds" function that way. It doesn't read well. "Greater than" is a synonym of exceeds. For exceeds(x, threshold), I'd expect to see "x > threshold"; i.e., x exceeds threshold.
I don't think the problem is the use of the operator, but rather its use is hidden; i.e., there isn't an explicit contract. Concepts would alleviate the issue.