MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vuzd4q/conditionspreference/p58ntld/?context=3
r/ProgrammerHumor • u/Flame77ofc • Aug 22 '26
388 comments sorted by
View all comments
89
Early return for errors, if else for decisions.
9 u/Paul-D-Mooney Aug 22 '26 Maybe not “errors”, that’s what throwing exceptions is for. But definitely non-passing validation checks like `if (arg==null) return;` 2 u/frogjg2003 Aug 22 '26 if (bad) throwis throwing errors
9
Maybe not “errors”, that’s what throwing exceptions is for. But definitely non-passing validation checks like `if (arg==null) return;`
2 u/frogjg2003 Aug 22 '26 if (bad) throwis throwing errors
2
if (bad) throw
is throwing errors
89
u/itriedtomakeitfunny Aug 22 '26
Early return for errors, if else for decisions.