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/SillAndDill Mar 15 '22 edited Mar 20 '22

True that bool==true is ugly as hell.

but if you accidentally use = instead of == then the entire codebase is at risk any time you check a variable value. 😲Just setting a rule for bools isn't a mentionable way of increasing dependability

but there are lint rules to prevent it. https://eslint.org/docs/rules/no-cond-assign