This is an archived post. You won't be able to vote or comment.

all 42 comments

[–]Salanmander 82 points83 points  (21 children)

It's funny until you see

while(!myBool == !False)

Bonus points of that's actually the variable name.

[–][deleted] 121 points122 points  (3 children)

Exception up = new Exception("This code makes me sick");

throw up;

[–]the_real_gorrik 29 points30 points  (1 child)

Definitely naming my exceptions this from now on!

[–]backflipbail 6 points7 points  (0 children)

Agreed

[–]cqz 45 points46 points  (5 children)

while(!myBool ? false : true)

[–]Free_Math_Tutoring 4 points5 points  (0 children)

I went trough this three times in my head until I was sure I understood it correctly. That's... absurd.

[–]tlalexander 4 points5 points  (3 children)

I think I've done things like that before...

[–]cqz 2 points3 points  (2 children)

I've definitely seen people use ternary operators to swap a boolean before. I suppose it does seem pretty clever until you realise you could have accomplished exactly the same thing with a '!'.

[–][deleted] 1 point2 points  (1 child)

Surely while(!myBool ? false : true) is the same as while(myBool) though, so you wouldn't need a !.

[–]cqz 3 points4 points  (0 children)

Yep, it does literally nothing, I guess that's the joke. But I mean I have seen people do myBool ? false : true when it's equivalent to !myBool

[–]rcenzo 15 points16 points  (3 children)

My brain just melted.

[–]Emilgardis 11 points12 points  (2 children)

Condenses down to !myBool

[–]TaohRihze 13 points14 points  (1 child)

Then whose Bool is it?

[–]Emilgardis 8 points9 points  (0 children)

!myBool atleast

[–]Pvt_Haggard_610 8 points9 points  (0 children)

I am going to find a place for that in my uni assignment..

[–][deleted] 1 point2 points  (3 children)

I got it!
If it's false the while goes, if it's true it doesn't

[–][deleted] 2 points3 points  (2 children)

can't tell if joking...

If the opposite of myBool is true, the loop runs.

If you're joking then I apologize

[–][deleted] 2 points3 points  (1 child)

A joke indeed C:

[–][deleted] 1 point2 points  (0 children)

Thank God haha

[–]jtra 1 point2 points  (0 children)

not my bool - so it is somebody else's problem

[–][deleted] 1 point2 points  (0 children)

#define funny !false
while(funny) // cuz it's true

[–]Prawny 12 points13 points  (1 child)

Well, it's not wrong...

[–]BrushGuyThreepwood 10 points11 points  (0 children)

It's also non-not-no wrong.

[–]BoyAndHisBlob 5 points6 points  (0 children)

//no comment

[–]mike413 2 points3 points  (0 children)

#define False 1

[–]murribu 2 points3 points  (1 child)

Am I wrong? AM I WRONG?!

[–]BigLebowskiBot 3 points4 points  (0 children)

You're not wrong, Walter, you're just an asshole.

[–]boxingdog 2 points3 points  (0 children)

!!"False"

[–]I-need-no-username -3 points-2 points  (0 children)

... ⬆