r/ProgrammerHumor • • Mar 15 '22

static bool isCrazyMurderingRobot = false;

Post image
4.9k Upvotes

257 comments sorted by

View all comments

Show parent comment

1

u/James-Livesey Mar 15 '22

Isn't it meant to return the value that was assigned to the variable to the if condition? Which, in the comic's case, will still be true

Example:

if (c = a == b) {
    /* c will be equal to true */
} else {
    /* c will be equal to false */
}

2

u/ShadowLp174 Mar 15 '22

Messed that up, sorry, it's late XD

2

u/James-Livesey Mar 15 '22

Fair, can be pretty confusing syntax sometimes anyway lol