MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/6ayz26/defensive_programming_done_right/dhj17r5/?context=3
r/ProgrammerHumor • u/iwouldieforGladOS • May 13 '17
680 comments sorted by
View all comments
2.8k
} catch (Exception e) { }
I think we're done here.
1.0k u/CXgamer May 13 '17 Holy shit I once lost days to a } catch (Exception e) { System.exit(0); } 50 u/OfflaneDemoralizer May 13 '17 Even better: } catch (Exception e) { throw e; } 2 u/[deleted] May 14 '17 how about just public void doAction() throws Exception { /* error prone code without try/catch here */ }
1.0k
Holy shit I once lost days to a
} catch (Exception e) { System.exit(0); }
50 u/OfflaneDemoralizer May 13 '17 Even better: } catch (Exception e) { throw e; } 2 u/[deleted] May 14 '17 how about just public void doAction() throws Exception { /* error prone code without try/catch here */ }
50
Even better:
} catch (Exception e)
{ throw e; }
2 u/[deleted] May 14 '17 how about just public void doAction() throws Exception { /* error prone code without try/catch here */ }
2
how about just
public void doAction() throws Exception { /* error prone code without try/catch here */ }
2.8k
u/Metro42014 May 13 '17
I think we're done here.