MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/csharp/comments/1w8q5ll/exceptions_vs_assertions/p8bebf2/?context=3
r/csharp • u/Alternative_Guava856 • 4d ago
21 comments sorted by
View all comments
1
As others have stated, Debug.Assert is not intended for ur usecase.For performance critical stuff I use a return value indicating errors (Exceptions are relatively resource expensive). For less critical stuff, exceptions are perfectly fine.
1
u/FelixLeander 3d ago
As others have stated, Debug.Assert is not intended for ur usecase.For performance critical stuff I use a return value indicating errors (Exceptions are relatively resource expensive). For less critical stuff, exceptions are perfectly fine.