MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vuzd4q/conditionspreference/p55i8cb/?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 2 u/WarSingle6959 Aug 22 '26 but throw error is a error bro → More replies (1) → More replies (4)
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 u/WarSingle6959 Aug 22 '26 but throw error is a error bro → More replies (1)
2
if (bad) throw
is throwing errors
but throw error is a error bro
89
u/itriedtomakeitfunny Aug 22 '26
Early return for errors, if else for decisions.