r/ProgrammerHumor • • Mar 15 '22

static bool isCrazyMurderingRobot = false;

/img/2g1k34ok5kn81.jpg
4.9k Upvotes

257 comments sorted by

View all comments

Show parent comment

1

u/SnakeBDD Mar 16 '22

Never ever do == true.

In C, every non-zero expression is considered true and since C has no native type for booleans, stdbool.h defines flase als 0 and true as ~false. So most values that eval as true in a boolean expression are actually != true.

Always go for != false.