4 ms·
And there are different version of 'dirty trick' perception too. Sometime what people perceive as 'dirty trick' is just normal use of the language while the mug
by buserror 10y ago
And there are different version of 'dirty trick' perception too. Sometime what people perceive as 'dirty trick' is just normal use of the language while the muggles want to talk baby talk all the time.
For example, having to explain the functional use of 'x = !!variable' to a C programmer. There are many like that.
Sometime you just have to decide to raise the bar a little...
- pklausler 10y agoI used !! for decades, but since C'99, I've recommended "bool x = variable" or "(bool) variable".
- yoklov 10y agoThe reason I would prefer !! (or != 0) is that there are far too many err, non-bool bools. Even if you know for sure it's the stdbool.h bool, the next reader might not be aware -- presuming that when you do this you care about the distinction (otherwise I agree that the cast is fine).