User: Password:
|
|
Subscribe / Log in / New account

Reitter: Answering the question: "How do I develop an app for GNOME?"

Reitter: Answering the question: "How do I develop an app for GNOME?"

Posted Feb 6, 2013 15:37 UTC (Wed) by adobriyan (guest, #30858)
In reply to: Reitter: Answering the question: "How do I develop an app for GNOME?" by randomguy3
Parent article: Reitter: Answering the question: "How do I develop an app for GNOME?"

Examples are fine. It is the programming language which allows both "a <= b" and "b <= a" to be true or false simultaneously is not.

Sane programming languages do not have this property.


(Log in to post comments)

Reitter: Answering the question: "How do I develop an app for GNOME?"

Posted Feb 6, 2013 15:53 UTC (Wed) by mpr22 (subscriber, #60784) [Link]

"a <= b" and "b <= a" being simultaneously true is fine because of the '=' part; I presume you mean that "a < b" and "b < a" being simultaneously true is indicative of a problem (which it is).

On the other hand, "a <= b" and "b <= a" being simultaneously false is sometimes compulsory (IEC 60559 floating point requires that all comparisons involving NaNs, including comparing a NaN to itself, return false.)

Reitter: Answering the question: "How do I develop an app for GNOME?"

Posted Feb 6, 2013 19:05 UTC (Wed) by JoeBuck (guest, #2330) [Link]

Well, yes; it's OK if < is a partial ordering with incomparible values (there can exist a,b such that neither a<b nor b<a are true).
<p>
But data structures and algorithms that depend on sorting break if there exist a,b,c such that a<b, b<c, and c<a are all true, so warts like this are a significant source of bugs.

Reitter: Answering the question: "How do I develop an app for GNOME?"

Posted Feb 6, 2013 19:13 UTC (Wed) by drag (subscriber, #31333) [Link]

I am a bit confused about all the above.

Especially the parts about using great-than and less-than to compare strings. Trying to program this way seems broken no matter what the language.

Reitter: Answering the question: "How do I develop an app for GNOME?"

Posted Feb 7, 2013 9:25 UTC (Thu) by micka (subscriber, #38720) [Link]

There are orders over the strings. One of them is even a total order, and is even understandable and useful (well, for alphabetic ones, it's sometimes a bit hard to generalize to even US-ASCII, and worse for UTF-8+locale), the lexicographic order (the one you learn when one gives you a dictionary).


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds