bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19208: replace-match unhelpful error message


From: Noam Postavsky
Subject: bug#19208: replace-match unhelpful error message
Date: Sat, 03 Aug 2019 19:59:45 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux)

>> Actually those were Leibniz conditionals, which are comparisons
>> involving "<" or "<=". The idea is that the conditionals' textual
>> order reflects numeric order. This is a common style in math when
>> doing range checking, e.g., "0 <= i < n". Yoda conditionals are
>> expressions like "0 != x" which I agree are confusing.
>
> Well, I think both are called Yoda conditionals, and they are
> demonstrably confusing for people not used to seeing conditionals
> written that way, which is I think pretty much everybody, except four
> people working on Emacs.  :-)
>
> In real life, nobody says "if 62 is less than your age, you're eligible
> for Medicare".

People might say things like "your height must be between 120 and 200 cm
to ride this roller coaster" as opposed to "your height must be more
than 120 cm and your height must be less than 200 cm".

> I think one should write code for legibility -- but opinions on what's
> legible various, of course.  Reading "if (62 < age)", for me, requires
> mental gymnastics.

"if (height > 120 && height < 200)" require mental gymnastics, for me,
because each comparison is a different direction.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]