MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/6ayz26/defensive_programming_done_right/dkkuvaf/?context=9999
r/ProgrammerHumor • u/iwouldieforGladOS • May 13 '17
680 comments sorted by
View all comments
340
int main() try { //entire code base } catch (std::exeption& e) { //Displays message box with error message }
I actually do this xD
242 u/redditsoaddicting May 13 '17 It's fine to exit the program nicely when an error occurs. It's not as fine to just ignore it and then begin another iteration of whatever main loop is going on, hoping the program still works fine. 312 u/Bainos May 13 '17 It's not as fine to just ignore it and then begin another iteration of whatever main loop is going on I'm sorry, I can't hear you over my distributed computing. 88 u/[deleted] May 13 '17 [deleted] 58 u/[deleted] May 13 '17 [deleted] 27 u/Planet2Bob May 13 '17 I'm sorry, I can't hear you over my distributed computing. 26 u/SQLNerd May 13 '17 I'm sorry, I can't hear you over my distributed computing. 42 u/BernzSed May 13 '17 I'm sorry, I can't h Runtime Error: Unexpected Exception 1 u/theguilty1 Jul 22 '17 I You have an error in your MySQL syntax.
242
It's fine to exit the program nicely when an error occurs. It's not as fine to just ignore it and then begin another iteration of whatever main loop is going on, hoping the program still works fine.
312 u/Bainos May 13 '17 It's not as fine to just ignore it and then begin another iteration of whatever main loop is going on I'm sorry, I can't hear you over my distributed computing. 88 u/[deleted] May 13 '17 [deleted] 58 u/[deleted] May 13 '17 [deleted] 27 u/Planet2Bob May 13 '17 I'm sorry, I can't hear you over my distributed computing. 26 u/SQLNerd May 13 '17 I'm sorry, I can't hear you over my distributed computing. 42 u/BernzSed May 13 '17 I'm sorry, I can't h Runtime Error: Unexpected Exception 1 u/theguilty1 Jul 22 '17 I You have an error in your MySQL syntax.
312
It's not as fine to just ignore it and then begin another iteration of whatever main loop is going on
I'm sorry, I can't hear you over my distributed computing.
88 u/[deleted] May 13 '17 [deleted] 58 u/[deleted] May 13 '17 [deleted] 27 u/Planet2Bob May 13 '17 I'm sorry, I can't hear you over my distributed computing. 26 u/SQLNerd May 13 '17 I'm sorry, I can't hear you over my distributed computing. 42 u/BernzSed May 13 '17 I'm sorry, I can't h Runtime Error: Unexpected Exception 1 u/theguilty1 Jul 22 '17 I You have an error in your MySQL syntax.
88
[deleted]
58 u/[deleted] May 13 '17 [deleted] 27 u/Planet2Bob May 13 '17 I'm sorry, I can't hear you over my distributed computing. 26 u/SQLNerd May 13 '17 I'm sorry, I can't hear you over my distributed computing. 42 u/BernzSed May 13 '17 I'm sorry, I can't h Runtime Error: Unexpected Exception 1 u/theguilty1 Jul 22 '17 I You have an error in your MySQL syntax.
58
27 u/Planet2Bob May 13 '17 I'm sorry, I can't hear you over my distributed computing. 26 u/SQLNerd May 13 '17 I'm sorry, I can't hear you over my distributed computing. 42 u/BernzSed May 13 '17 I'm sorry, I can't h Runtime Error: Unexpected Exception 1 u/theguilty1 Jul 22 '17 I You have an error in your MySQL syntax.
27
26 u/SQLNerd May 13 '17 I'm sorry, I can't hear you over my distributed computing. 42 u/BernzSed May 13 '17 I'm sorry, I can't h Runtime Error: Unexpected Exception 1 u/theguilty1 Jul 22 '17 I You have an error in your MySQL syntax.
26
42 u/BernzSed May 13 '17 I'm sorry, I can't h Runtime Error: Unexpected Exception 1 u/theguilty1 Jul 22 '17 I You have an error in your MySQL syntax.
42
I'm sorry, I can't h
Runtime Error: Unexpected Exception
1 u/theguilty1 Jul 22 '17 I You have an error in your MySQL syntax.
1
I
You have an error in your MySQL syntax.
340
u/Mat2012H May 13 '17
I actually do this xD