Thanks in advance.
Reitter: Answering the question: "How do I develop an app for GNOME?"
Posted Feb 6, 2013 15:12 UTC (Wed) by randomguy3 (subscriber, #71063)
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 (guest, #30858)
Sane programming languages do not have this property.
Posted Feb 6, 2013 15:53 UTC (Wed) by mpr22 (subscriber, #60784)
"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 (guest, #2330)
Posted Feb 6, 2013 19:13 UTC (Wed) by drag (subscriber, #31333)
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)
Posted Feb 6, 2013 20:34 UTC (Wed) by khim (subscriber, #9252)
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?).
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.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds