Assert a good practice or not?

前端 未结 7 1338
礼貌的吻别
礼貌的吻别 2021-01-30 05:02

Is it a good practice to use Assert for function parameters to enforce their validity. I was going through the source code of Spring Framework and I noticed that they use

7条回答
  •  被撕碎了的回忆
    2021-01-30 05:49

    I'm keeping my assertions in released binaries but with modified behavior: abort is not called but stacktrace is collected.

    More details here: http://blog.aplikacja.info/2011/10/assert-to-abort-or-not-to-abort-thats-the-question/

提交回复
热议问题