Ne zaman Debug.Assert kullanmalıyım?
Debug.Assert için stackoverflow.com da güzel bir soru ve tonla cevap var.
Bu da beğendiğim bir cevap:
You should use Debug.Assert to test for logical errors in your programs. The complier can only inform you of syntax errors. So you should definetely use Assert statements to test for logical errors. Like say testing a program that sells cars that only BMWs that are blue should get a 15% discount. The complier could tell you nothing about if your program is logically correct in performing this but an assert statement could.
Hiç yorum yok:
Yorum Gönder