When should I use Debug.Assert()?

后端 未结 20 1715
说谎
说谎 2020-11-30 16:12

I\'ve been a professional software engineer for about a year now, having graduated with a CS degree. I\'ve known about assertions for a while in C++ and C, but had no idea t

20条回答
  •  一个人的身影
    2020-11-30 16:53

    I would not use them in production code. Throw exceptions, catch and log.

    Also need to be careful in asp.net, as an assert can show up on the console and freeze the request(s).

提交回复
热议问题