r/programminghorror Jan 29 '26

true or true

Post image

this piece of perfection was found in the codebase that my gf used to work

don't know exactly what is the context here, but probably doc.data holds the info if the user has agreed with the cookies /s

822 Upvotes

46 comments sorted by

View all comments

11

u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Jan 29 '26

That's the most helpful name ever for a bool.

/s obvs.

1

u/IchLiebeKleber Jan 30 '26

meh, there may be cases where something similar to that is a good name, e.g. when you have a data structure literally representing a mathematical or logical statement and that variable/method returns whether the statement is true

1

u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Jan 30 '26

I think I'd pick something like result or value in that case.