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 6:09 UTC (Wed) by Cyberax (✭ supporter ✭, #52523)In reply to: Reitter: Answering the question: "How do I develop an app for GNOME?" by FranTaylor
Parent article: Reitter: Answering the question: "How do I develop an app for GNOME?"
Thanks in advance.
Posted Feb 6, 2013 15:12 UTC (Wed)
by randomguy3 (subscriber, #71063)
[Link] (6 responses)
Not that I don't think that JS is a bit mad in places, or that functional languages aren't a good thing, mind. I just think your examples were somewhat disingenuous.
Posted Feb 6, 2013 15:37 UTC (Wed)
by adobriyan (subscriber, #30858)
[Link] (4 responses)
Sane programming languages do not have this property.
Posted Feb 6, 2013 15:53 UTC (Wed)
by mpr22 (subscriber, #60784)
[Link] (3 responses)
"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.)
Posted Feb 6, 2013 19:05 UTC (Wed)
by JoeBuck (subscriber, #2330)
[Link] (2 responses)
Posted Feb 6, 2013 19:13 UTC (Wed)
by drag (guest, #31333)
[Link] (1 responses)
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.
Posted Feb 7, 2013 9:25 UTC (Thu)
by micka (subscriber, #38720)
[Link]
Posted Feb 6, 2013 20:34 UTC (Wed)
by khim (subscriber, #9252)
[Link]
Of course the examples made no sense! That's exactly the point! You see, there are statically typed languages (Java, with some limitations C/C++, etc: if you don't use floating point values you are pretty safe there): errors like these will be detected at compile time and you'll fix them before program will be even started for the first time. There are dynamically typed languages (Lisp, Python, etc): errors like these will be detected at runtime and end-user will see cryptic error message - embarrassing, to be sure, but not the end of the world. And finally there are languages like PHP or JavaScript: errors like these will be detected when your applications it cracked and is happily sending spam all over the internet (or, alternatively, when your credit card info is stolen and your account is emptied). Yes, JavaScript [...] [is] surprisingly good considering the speed at which it was created, I fully agree. It's still a crazy language which would never be used for anything serious in a better world. In our world it must be avoided as much as possible: there are cases where you are forced to use it, but there are no need to propagate this insanity further then necessary.
Reitter: Answering the question: "How do I develop an app for GNOME?"
Reitter: Answering the question: "How do I develop an app for GNOME?"
Reitter: Answering the question: "How do I develop an app for GNOME?"
Reitter: Answering the question: "How do I develop an app for GNOME?"
<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?"
Reitter: Answering the question: "How do I develop an app for GNOME?"
Reitter: Answering the question: "How do I develop an app for GNOME?"
Your examples mostly just made no sense - they worked in an unexpected way because there was really no sane expected behaviour (why should "a" be in any way comparable to 10, for example? What does it mean to add up the contents of a string?).
