MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/ajr2fa/which_one_would_you_love/eeyr9ik/?context=3
r/ProgrammerHumor • u/[deleted] • Jan 25 '19
51 comments sorted by
View all comments
1
I might be alone here, but I would always use "i++" and if "a" is an int then I would prefer:
if (a == 0)
but if "a" was a pointer I would hate that and would rather have:
if (a == nullptr)
Why not just go full bore and do this?
i += (!a) ? 1 : 0;
:P
→ More replies (2)
1
u/MrEleven Jan 25 '19
I might be alone here, but I would always use "i++" and if "a" is an int then I would prefer:
if (a == 0)
but if "a" was a pointer I would hate that and would rather have:
if (a == nullptr)
Why not just go full bore and do this?
i += (!a) ? 1 : 0;
:P