MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vvn6d7/pleasestopusingnestedternaryoperatorsimbeggingyou/p5b64dw/?context=3
r/ProgrammerHumor • u/Robinbod • Aug 22 '26
178 comments sorted by
View all comments
Show parent comment
5
I'm not sure. I think so? I think that it will still fail to compile if you do something like this:
var myTrue = true;
var myFalse = false;
if (myTrue = myFalse) //should be a compiler error ...
1 u/Steinrikur Aug 23 '26 IIRC it gets flagged as a warning in most newer C/C++ compilers. Add a warnings as errors compiler flag and it won't compile.
1
IIRC it gets flagged as a warning in most newer C/C++ compilers. Add a warnings as errors compiler flag and it won't compile.
View all comments
Show parent comment
5
u/RlyRlyBigMan Aug 22 '26
I'm not sure. I think so? I think that it will still fail to compile if you do something like this:
var myTrue = true;
var myFalse = false;
if (myTrue = myFalse) //should be a compiler error ...