Re: [PATCH 0/4] Re: [PATCH 3/4] t: rev-parse-parents: avoid yoda conditions
- From
Jeff King <peff@peff.net>
- Date
- Sep 8, 2013, 04:06 UTC
- Message-ID
- <20130908040615.GA14019@sigill.intra.peff.net>
- In-Reply-To
- <CAMP44s3O=cHAtHOj41MccBDOausukb49MV-E6jib6n6czs+p3Q@mail.gmail.com>
On Sat, Sep 07, 2013 at 10:11:49PM -0500, Felipe Contreras wrote:
Show 6 quoted lines
> > Though I prefer the current, I can certainly live and adapt to a changed > > standard, and I do not mind doing so if there is a good reason. But I've > > yet to see any argument beyond "it is not what I like". Which to me > > argues for the status quo as the path of least resistance. > > Didn't Junio already provided reasoning?
If the reasoning is "cmp(actual, expect) makes more sense to humans" then I do not think it is universal. Otherwise why would so many existing test frameworks do it the other way? And that is why I said it seems more like an issue of personal preference than a universal truth.
Was there some objective argument made that I missed?
Show 10 quoted lines
> Here's more; human semantics: > > Computer, compare A with B > cmp(A, B) > > Why would I write? > > cmp(B, A) > > Could you even construct an English sentence that starts with B, and then A?
"Computer, given that we expect B, how does A differ?". Or "Computer, we expect B; does A match it?"
Or any number of variations. I'm sure you will say "but those seem awkward and unlike how I think about it". But that was my point; it seems to be a matter of preference.
-Peff