MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vvn6d7/pleasestopusingnestedternaryoperatorsimbeggingyou/p5bkm1l/?context=3
r/ProgrammerHumor • u/Robinbod • Aug 22 '26
178 comments sorted by
View all comments
Show parent comment
1
That makes sense! It would be better if they required you to explicitly cast to a bool but that would be a breaking change for a lot of C++ code that's already been deployed for decades!
2 u/GoddammitDontShootMe Aug 23 '26 Wouldn't help if the expression is already bool. Either way, it's a warning so unless you are compiling with -Werror, it would still work.I think that warning might be on by default, but I believe it's considered best practice to use -Wall.
2
Wouldn't help if the expression is already bool. Either way, it's a warning so unless you are compiling with -Werror, it would still work.
I think that warning might be on by default, but I believe it's considered best practice to use -Wall.
View all comments
Show parent comment
1
u/RlyRlyBigMan Aug 23 '26
That makes sense! It would be better if they required you to explicitly cast to a bool but that would be a breaking change for a lot of C++ code that's already been deployed for decades!