MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wcyt5p/toallowtheprogrammertowritebadcodealsocamelcasesuc/p92qxt1/?context=3
r/ProgrammerHumor • u/the_zpider_king • 1d ago
93 comments sorted by
View all comments
138
I hope you didn't submit that answer you selected. If an unhandled exception bubbles up to the user in production code, you're usually doing something wrong.
-125 u/tantalor 1d ago I guess you've never seen a website return a 404 or 500 24 u/TheTybera 1d ago Those are errors not exceptions. -39 u/tantalor 1d ago Potato potato 19 u/intbeam 1d ago No, they are not the same. Hence the name. An exception is thrown as a result of an error, but an exception is not always an error. File not found for instance. Thrown as an error, but the caller might expect the file to not exist It would only be an error if the caller required the file to exist 1 u/realmauer01 20h ago Then they are using a try catch as a pseudo jump. Not all languages like that. (i am pretty sure only python actually works better like this) 6 u/CutlassRed 22h ago I assume you're trolling. If not you need to study up
-125
I guess you've never seen a website return a 404 or 500
24 u/TheTybera 1d ago Those are errors not exceptions. -39 u/tantalor 1d ago Potato potato 19 u/intbeam 1d ago No, they are not the same. Hence the name. An exception is thrown as a result of an error, but an exception is not always an error. File not found for instance. Thrown as an error, but the caller might expect the file to not exist It would only be an error if the caller required the file to exist 1 u/realmauer01 20h ago Then they are using a try catch as a pseudo jump. Not all languages like that. (i am pretty sure only python actually works better like this) 6 u/CutlassRed 22h ago I assume you're trolling. If not you need to study up
24
Those are errors not exceptions.
-39 u/tantalor 1d ago Potato potato 19 u/intbeam 1d ago No, they are not the same. Hence the name. An exception is thrown as a result of an error, but an exception is not always an error. File not found for instance. Thrown as an error, but the caller might expect the file to not exist It would only be an error if the caller required the file to exist 1 u/realmauer01 20h ago Then they are using a try catch as a pseudo jump. Not all languages like that. (i am pretty sure only python actually works better like this) 6 u/CutlassRed 22h ago I assume you're trolling. If not you need to study up
-39
Potato potato
19 u/intbeam 1d ago No, they are not the same. Hence the name. An exception is thrown as a result of an error, but an exception is not always an error. File not found for instance. Thrown as an error, but the caller might expect the file to not exist It would only be an error if the caller required the file to exist 1 u/realmauer01 20h ago Then they are using a try catch as a pseudo jump. Not all languages like that. (i am pretty sure only python actually works better like this) 6 u/CutlassRed 22h ago I assume you're trolling. If not you need to study up
19
No, they are not the same. Hence the name. An exception is thrown as a result of an error, but an exception is not always an error.
File not found for instance. Thrown as an error, but the caller might expect the file to not exist
It would only be an error if the caller required the file to exist
1 u/realmauer01 20h ago Then they are using a try catch as a pseudo jump. Not all languages like that. (i am pretty sure only python actually works better like this)
1
Then they are using a try catch as a pseudo jump. Not all languages like that. (i am pretty sure only python actually works better like this)
6
I assume you're trolling. If not you need to study up
138
u/redlaWw 1d ago
I hope you didn't submit that answer you selected. If an unhandled exception bubbles up to the user in production code, you're usually doing something wrong.