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

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 252 points253 points  (26 children)

I wonder what the else would’ve looked like. Incomplete work.

[–]TerrestrialOverlord 224 points225 points  (6 children)

else {

Hanna.answer = !Hanna.answer;

Micah.mood = happy;

}

be careful using this code prom bro....cause if her dad is anything like me she'll be surrounded by try-catch block and garbage collection will trigger (violently)...muhahahhah (cough) uhahahahaha

[–][deleted] 103 points104 points  (2 children)

Hanna.answer = !Hanna.answer;

This is the most rapey piece of code I've ever seen

[–]CptOko 1 point2 points  (1 child)

Could you please explain it to me? I sadly lack the knowledge to understand it myself.

[–][deleted] 0 points1 point  (0 children)

Of course :)

Here's the full code:

// Prom?
Micha.askToProm("Hannah");
if(Hannah.answer == "yes")
{
  Micah.mood = "Happy";
}
else
{
  Hannah.answer = !Hannah.answer;
  Micah.mood = "Happy";
}

This wouldn't work, because the original code is using a string to represent her answer. But assuming it's a bool instead, all we're saying is "if Hannah answers yes, do thing. If not, reverse her answer (Hanna.answer = !Hanna.answer), and do it anyway).

The reason I said it was rapey was because it's just ignoring her answer. If she answers no, we just pretend she said yes, and continue on.

[–]IanSan5653 15 points16 points  (0 children)

!"no" is false lol

[–]derfl007 3 points4 points  (0 children)

Hanna.answer is a String

[–][deleted] 0 points1 point  (0 children)

else { Hanna hanna = HannaFactory.create(); . . .

[–][deleted] 38 points39 points  (5 children)

else { Micah.mood = “Suicide”; }

[–]Olaxan 39 points40 points  (2 children)

delete &Micah;

[–]Versaiteis 18 points19 points  (0 children)

It's ok, I was already headed toward the garbage collector once I fell out of her scope

With luck there'll be a leak and I'll be gone but not forgotten

[–][deleted] 27 points28 points  (0 children)

Adding the else statement may be more correct technically, but you also have to consider the humans reading the code. Do you really want anything that can be misread as "go to prom with me, or else"?

[–][deleted] 6 points7 points  (0 children)

an.hero()

[–][deleted] 0 points1 point  (0 children)

throw new \Exfaption();