|
because it doesn't make sense? like apple + potato doesn't equal apple anything / 0 is NaN infinity + 1 is still infinity an int + a thing that is not an int isn't an int although perhaps you are a php developer
|
# ? Mar 24, 2016 03:39 |
|
|
# ? May 25, 2024 13:34 |
|
|
# ? Mar 24, 2016 03:39 |
|
|
# ? Mar 24, 2016 03:41 |
|
BiohazrD posted:although perhaps you are a php developer hahaha what the gently caress?
|
# ? Mar 24, 2016 04:19 |
Hey at least it's commutative!
|
|
# ? Mar 24, 2016 04:29 |
|
literally true == NaN i can't deal with this goondolences to every php dev e: 0 == "php" gently caress i cant stop laughing HoboMan fucked around with this message at 04:55 on Mar 24, 2016 |
# ? Mar 24, 2016 04:53 |
|
Condiv posted:how does 0 + null = null make any sense at all? MSDN posted:The predefined unary and binary operators and any user-defined operators that exist for value types may also be used by nullable types. These operators produce a null value if the operands are null; otherwise, the operator uses the contained value to calculate the result. vs immediate: code:
|
# ? Mar 24, 2016 05:00 |
|
false == 0 == "php" == true
|
# ? Mar 24, 2016 05:01 |
|
the past tense verb for getting a kik message is "kiked" just an fyi
|
# ? Mar 24, 2016 05:14 |
|
poo poo was going well until i got kiked
|
# ? Mar 24, 2016 05:14 |
|
i kept my node modules open sourced until those lawyers kiked me
|
# ? Mar 24, 2016 05:15 |
|
this is all solved in a very reasonable way in haskell with monoids btw.
|
# ? Mar 24, 2016 05:22 |
|
where can i learn more about schema-less databases? boss wants me to have real reason for wanting a normalized relational db even though we we need to emulate relationships in a schema-less db. i think he's pushing me to my limits and trying to make me learn some poo poo rather that just letting me get away with saying schema-less is bad so i can grow as a dev. i really appreciate it and don't want to let him down. also i would like to get to coding so the quicker all this poo poo is taken care off the better.
|
# ? Mar 24, 2016 05:44 |
|
HoboMan posted:goondolences to every php dev thank you.
|
# ? Mar 24, 2016 05:57 |
|
i have a terrible programmer question about testing (in c#). i am writing a plugin for other software. every api i interact with uses concrete objects. how do i fake objects for testing? for example, say i've got a FiddleWithHostDocument(HostDocument doc) method, and i want to make sure that when it runs, it sets the HostDocument.IsModified flag on the document it's passed. i can't just mock out HostDocument, because it's sealed. the only thing i was able to think of (other than using one of those mocking frameworks that rewrites IL or whatever) was, for each host api class i care about, to create a corresponding wrapper interface and concrete implementation that forwards interface calls to wrapped actual host objects, and then have my logic only interact with the interfaces, but
|
# ? Mar 24, 2016 06:26 |
|
i like » NaN === NaN false » var a = NaN; a === a false
|
# ? Mar 24, 2016 06:31 |
|
KidDynamite posted:boss wants me to have real reason for wanting a normalized relational db even though we we need to emulate relationships in a schema-less db. because you're not a loving idiot, that's why you want a normalized relational database also at least some common "NoSQL" implementations turn out to be isomorphic to the relational algebra anyway, especially as used, just with worse performance and no ACID guarantees that a real relational database (even SQLite) can provide there was a proof 5-6 years ago that I can't find now but I recall it being pretty straightforward
|
# ? Mar 24, 2016 08:03 |
|
in lisp, eq compares object identity, but for numbers and characters the implementation is allowed to make copies whenever it's convenient for it, so for examplecode:
|
# ? Mar 24, 2016 08:57 |
|
KidDynamite posted:where can i learn more about schema-less databases?
|
# ? Mar 24, 2016 08:57 |
|
weird posted:in lisp, eq compares object identity, but for numbers and characters the implementation is allowed to make copies whenever it's convenient for it, so for example now explain the difference between eq, eql, equal, and equalp then grab the new update to Mezzano and start hacking on a brand new Lisp Machine for your x86-64 virtual machine of choice (as long as it does virtio networking) a good starting point would be to add system & site init files and then, more ambitiously, a system mode line at the bottom, like the old Lisp Machines had, instead of the random bars of color at the very top of the screen to say what the system is doing (seriously, Mezzano is cool and good for how small it is, and it's worth reading some of the code just to see how little it takes to put together a working OS in a high level language) eschaton fucked around with this message at 09:53 on Mar 24, 2016 |
# ? Mar 24, 2016 09:51 |
|
lots of infernal stupid parenthesis
|
# ? Mar 24, 2016 10:41 |
|
BiohazrD posted:because it doesn't make sense? null should have 0 operations defined for it. it is an instance of a pseudo bottom type and quite frankly even implicitly converting it to another type really sucks. but that behavior is way more sane than 0 + null = null. also, null + 0 and 0 + null in c# is an int. code:
Condiv fucked around with this message at 11:38 on Mar 24, 2016 |
# ? Mar 24, 2016 11:18 |
|
Condiv posted:null should have 0 operations defined for it. it is an instance of a pseudo bottom type and quite frankly even implicitly converting it to another type really sucks. these two sentences are contradictory? {val} + ⊥ becomes ⊥ for all {val}, what other implementation makes the remotest sense? if you must, you can look at it as + not being defined for ⊥, so the overall statement also evaluates as ⊥
|
# ? Mar 24, 2016 11:38 |
|
Condiv posted:but that behavior is way more sane than 0 + null = null. How? Null is not zero. It should error out like divide by zero or a null pointer. I just spent like a day of work trying to trace bugs like this in code where poo poo like NaN, null, and Infinity gets silently massaged to acceptable input and it's a loving nightmare. If you're trying to use a null for anything the program should crash hard, something bad has happened. The language deciding that null means zero is the loving worst case. The language doesn't know why that value is null so massaging it to zero is making a loving big assumption without any information. Null is not some innate property of the universe. Null is chosen as a returnable value by programmers for some specific purpose, and massaging it to zero stomps all over whatever message was trying to be sent. The language doesn't have enough information to make the decision that null should mean 0 so it shouldn't be making that decision. At some point in the last couple decades idiots decided a program crashing was the worst sin ever, and instead of having people write better code they decided it was better for poo poo to plod along with unpredictable state. That's stupid. That leads to data corruption. That leads to stack traces that are functionally meaningless because you only find out something got nulled or NaN'ed when you use a function that doesn't massage things to a proper type. ErIog fucked around with this message at 11:46 on Mar 24, 2016 |
# ? Mar 24, 2016 11:41 |
|
Jabor posted:these two sentences are contradictory? {val} + ⊥ becomes ⊥ for all {val}, what other implementation makes the remotest sense? is there a language where you can actually do {val} + ⊥ ? and an implementation that makes sense is to not be able to instantiate the bottom type or have a literal representing the bottom type. Condiv fucked around with this message at 11:49 on Mar 24, 2016 |
# ? Mar 24, 2016 11:46 |
|
ErIog posted:How? Null is not zero. It should error out like divide by zero or a null pointer. I just spent like a day of work trying to trace bugs like this in code where poo poo like NaN, null, and Infinity gets silently massaged to acceptable input and it's a loving nightmare. If you're trying to use a null for anything the program should crash hard, something bad has happened. The language deciding that null means zero is the loving worst case. The language doesn't know why that value is null so massaging it to zero is making a loving big assumption without any information. i agree it should error out because null is not an int and cannot be represented by an int. but both C# and java implicitly convert null into a value type if you use it as a literal in an expression. that behavior is saner than returning null from the expression null + 0, but it still sucks. Nullable<int> + int = Nullable<int> makes sense though, as well as (int?) null + 5 == (int?) null. Condiv fucked around with this message at 11:53 on Mar 24, 2016 |
# ? Mar 24, 2016 11:47 |
|
Condiv posted:i agree it should error out because null is not an int and cannot be represented by an int. but both C# and java implicitly convert null into a value type if you use it as a literal in an expression. that behavior is saner than returning null from the expression null + 0, but it still sucks. 0 + null = null is certainly passing the buck, but it seems way more defensible than 0 + null = 0. You still haven't explained why you think the former is the saner choice.
|
# ? Mar 24, 2016 11:51 |
|
ErIog posted:0 + null = null is certainly passing the buck, but it seems way more defensible than 0 + null = 0. You still haven't explained why you think the former is the saner choice. yes i have. null as a literal has no operations on it and cannot be added to 0. that leaves you with the option of implicitly casting null as an int (a bad decision, but one C# takes), or throwing a compile time error (a better idea imo). 0 + (int?) null = (int?) null in c#, and that makes sense because Nullable<int> behaves like a Maybe or Option type with an implicit map function. code:
code:
Condiv fucked around with this message at 12:20 on Mar 24, 2016 |
# ? Mar 24, 2016 11:59 |
|
c# is just paving the way for future quantum programmers.
|
# ? Mar 24, 2016 12:03 |
|
my life as a null0
|
# ? Mar 24, 2016 12:15 |
|
Wheany posted:i like that's just a perfectly normal feature of IEEE 754
|
# ? Mar 24, 2016 12:46 |
|
NaN isnt anything and should not be equal to anything null is a thing that should be equal only to itself 0 + null should be an exception 0 + an int? where the int? does not contain a value idk im not super bothered if + is defined on that but it still feels like it should return an int? that does not contain a value
|
# ? Mar 24, 2016 12:49 |
|
qntm posted:that's just a perfectly normal feature of IEEE 754 i know, but it sure as hell isn't intuitive
|
# ? Mar 24, 2016 13:25 |
|
i used to work on a huge C codebase from the 90s that was originally on SPARC that depended on x / 0 == 0. it was a bitch to port to x86, lemme tell you
|
# ? Mar 24, 2016 13:26 |
|
Bloody posted:NaN isnt anything and should not be equal to anything
|
# ? Mar 24, 2016 13:44 |
|
CRIP EATIN BREAD posted:i used to work on a huge C codebase from the 90s that was originally on SPARC that depended on x / 0 == 0.
|
# ? Mar 24, 2016 13:44 |
|
it also depended on weird compiler/linker behavior such as allowing duplicate symbols to be linked together (and randomly picking one of them to use in the compilation unit). instead of making a library it just linked .o files in at random from all over the project or just copy/pasted functions randomly into other files.
|
# ? Mar 24, 2016 13:51 |
|
qntm posted:that's just a perfectly normal feature of IEEE 754 bs, only because its servicable to some degree unlike sNaN if signaling NaNs were a thing that was guaranteed to work well, do you really think they'd be be turned off in any non p-lang by default?
|
# ? Mar 24, 2016 13:53 |
|
|
# ? Mar 24, 2016 13:54 |
|
|
# ? May 25, 2024 13:34 |
|
That's IEEE Standard 754 on floating points. ±∞ × 0 => NaN ±nonZero ÷ ±0 => ±∞ Not a javascript horror.
|
# ? Mar 24, 2016 14:14 |