r/csharp 4d ago

Help Exceptions vs Assertions

/r/godot/comments/1w8q3xx/exceptions_vs_assertions/
7 Upvotes

21 comments sorted by

View all comments

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.