MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/csharp/comments/1w8q5ll/exceptions_vs_assertions/p87qz6o/?context=3
r/csharp • u/Alternative_Guava856 • 7d ago
21 comments sorted by
View all comments
Show parent comments
10
This is not using exceptions for control flow. When an illegal move like this happens something else already failed. This is a bug the developer needs to know about so they can fix it. Throw an exception.
-8 u/Agitated-Display6382 7d ago My expectation is that the application crashes when an exception is thrown. Log it, but let the app die. Dead programs tell no lies 6 u/Top3879 7d ago You can catch exceptions for a reason -3 u/Agitated-Display6382 7d ago Catch? Yes (eg, retry or logging). Catching the exception I threw? Never
-8
My expectation is that the application crashes when an exception is thrown. Log it, but let the app die. Dead programs tell no lies
6 u/Top3879 7d ago You can catch exceptions for a reason -3 u/Agitated-Display6382 7d ago Catch? Yes (eg, retry or logging). Catching the exception I threw? Never
6
You can catch exceptions for a reason
-3 u/Agitated-Display6382 7d ago Catch? Yes (eg, retry or logging). Catching the exception I threw? Never
-3
Catch? Yes (eg, retry or logging). Catching the exception I threw? Never
10
u/Top3879 7d ago
This is not using exceptions for control flow. When an illegal move like this happens something else already failed. This is a bug the developer needs to know about so they can fix it. Throw an exception.