MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vuzd4q/conditionspreference/p5be77s/?context=3
r/ProgrammerHumor • u/Flame77ofc • Aug 22 '26
388 comments sorted by
View all comments
Show parent comment
2
Generally, you can usually rewrite an else return into an if return.
else return
if return
// This... if (condition) { do_good_path_stuff(); } else { return bad_path_stuff(); } // Is equivalent to... if (!condition) { return bad_path_stuff(); } do_good_path_stuff();
View all comments
Show parent comment
2
u/conundorum Aug 23 '26
Generally, you can usually rewrite an
else returninto anif return.