4 ms·
This feels to me like you're introducing the same unnecessary extra layer into your text as in the original code. I mean, why not "You are probably interested
by gjm11 3y ago
This feels to me like you're introducing the same unnecessary extra layer into your text as in the original code. I mean, why not
"You are probably interested in whether it's true that the 'need_free' flag is set to true"
leading to
> if ((need_free == true) == true)
? Answer: because that extra layer of indirection adds nothing, and just gives you a bit of extra cognitive load and an extra opportunity to make mistakes. I think the same is true about going from "need_free" to "need_free is set to true".
(This becomes less clear if you have variable names like 'need_free_flag'. I say: so don't do that then! It's almost always appropriate to give boolean values and functions that return boolean values names that reflect what it means when the value is true.)
- deleted 3y ago[deleted]