Hacker News new | ask | show | jobs
by LionessLover 3681 days ago
In addition to the reply with the pointer to the standards, sure NaN !== NaN.

NaN means "no idea what we've got here". When you get to say that phrase, would you expect it to be used for exactly one thing and one thing only? To me "I have no idea" means the possibilities are endless (infinite). We can only compare for equality when we know what we are looking at, otherwise it's just "status unknown". Yes, it might be equality - the chances are infinitely small though.

If you take the argument a step further and say "but I got the two NaNs that I compare doing the exact same operation, so even if I don't know what I've got from a mathematical point of view whatever it is it should be equal". In that case you are not actually comparing the NaNs but the path(s) that got you there.

I must say I find the whole NaN, null, 0 vs. undefined interesting on so many levels. There is a world of a difference between knowing you've got nothing (null or 0) and not knowing what've you've got at all.

"null": I have no bank account. "0": my balance is 0. "undefined" or "NaN": I lost my memory after yesterdays binge drinking and don't know who I am and if I got a bank account or not. Knowledge vs. no knowledge.

1 comments

Again, I am aware of what the behavior is, although this was a nice refresher and I appreciate it ;)

The joke was, of course, surrounding the Mozilla incedent where Brendan Eich stepped down from his position as CEO apparently because of a perception that he was promoting inequality. This characterization was due to his support of prop 8 (a bill about marriage equality, or lake there of).

To completely ruin the joke's punchline[1], was that the "problems he had with equality" were actually his understanding of types and language development and are evident in javascript.

Of course that is untrue, was a joke, and Brendan Eich is a legendary programmer whose contributions I am grateful for.

[1] Joke's punchline could be ruined by it being both a bad joke needing an explanation, being in poor taste, and generally just not being a funny joke.

> and generally just not being a funny joke.

I thought it was damn funny. There was definitely an unintended outburst at my desk.

But then...... I also thought it was spectacularly hypocritical of Mozilla to fire him for having what amounted to... ideals. Which is what Mozilla supposedly works to protect.

> But then...... I also thought it was spectacularly hypocritical of Mozilla to fire him for having what amounted to... ideals.

They didn't fire him for having ideals. One, because they didn't fire him, and, more significantly, because the problem was not him having ideal, but him being unable to determine or unwilling to take the steps necessary to effectively manage a major PR incident affecting Mozilla's relationship with users, employees, and other important stakeholders. (Or, given that he actually resigned, maybe he was quite able to determine and willing to take the necessary steps, but those steps were inconsistent with him remaining as CEO.)