69 points

== is a heathen with no rightful place except equality to null. All praise ===

permalink
report
reply
34 points

That’s what I used to think but it turns out to be the most Christian operator there is.

permalink
report
parent
reply
25 points

Eval works in mysterious ways

permalink
report
parent
reply
7 points

I Object to your terrible pun

permalink
report
parent
reply
29 points

Sorry, 0 == '\t'? What?

permalink
report
reply
18 points
*

that’s not “t”, it’s “\t” which is just a tab. There’s also “\n” for newline.

permalink
report
parent
reply
20 points

It still makes no sense though

permalink
report
parent
reply
22 points

If " " wasn’t equal to 0, it wouldn’t make sense, but since a string containing a space equals 0, you’d expect the same to apply to a string containing a tab or a newline. (or at least I’d expect that)

permalink
report
parent
reply
10 points

It’s a slash-t in the comment. Maybe kbin has different rendering rules for comments?

permalink
report
parent
reply
1 point
*

Oh, in that case I replied to @MinekPo1 with my answer to that. BTW can you see the slash in: \t and "\t".

permalink
report
parent
reply
2 points

yeah but why is a single character string containing a tab equal to zero ???

permalink
report
parent
reply
2 points
*

That would be weird if a string containing a space wasn’t equal to 0 " " == 0, but that’s not the case in JS. If you think that "" and " " being equal to 0 is weird then I agree, but since they are, you should expect "\t" and "\n" to equal 0 too.

permalink
report
parent
reply
1 point

The == operator in JS will try to cast the things being compared and do all kinds of ‘smart’ assumptions about what equality means. This is why everyone uses === instead…

permalink
report
parent
reply
1 point
Deleted by creator
permalink
report
parent
reply
8 points

Yeah, it’s true. I knew all the other ones, had to put that one in the dev tools console to believe it. I was just happy to know === continues to be sane in that comparison.

permalink
report
parent
reply
5 points

You have to remember that the underlying principle of JavaScript seemed to be “never throw an error”, even if what it’s being told to do is weapons grade bollocks.

permalink
report
parent
reply
24 points

Are people really not using the strict equality operator?

permalink
report
reply
7 points

It’s still pretty bad that the normal equality operator is as bad as it is.

permalink
report
parent
reply
2 points

If you’re provided a tool that solves a problem, I don’t really get ignoring that and continuing to focus on that solved problem as if it weren’t solved because you think all the tools should solve it on principle

permalink
report
parent
reply
12 points

That’s a little bit like saying, “I don’t understand why people continue to complain about the landmine sitting right there on the ground. We’ve painted it red so you can easily walk around it, so how has the problem not been solved?”

permalink
report
parent
reply
19 points

“The trinity makes as much sense as Javascript” is a vulgar condemnation of Christian dogma.

permalink
report
reply
18 points

Fuck this language with a pineapple

permalink
report
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 7.1K

    Monthly active users

  • 954

    Posts

  • 36K

    Comments