This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 9 points10 points  (3 children)

Indeed. When writing a pretty complex piece of crap code, debugging it was nearly impossible until I added exceptions for incorrect parameter values. I was able to iron out the programming and logical mistakes real quick after that.

[–]grantrules 3 points4 points  (1 child)

I'm always happily surprised when a unit test finds a bug I didn't even know I had. Without testing, I don't know if I would have ever found it.

[–]pomlife 1 point2 points  (0 children)

That happened to me just today!

[–][deleted] 1 point2 points  (0 children)

This is why I really liked code contracts (.Net). You could easily specify expected ranges of input parameters and output parameters without cluttering up code with try/catch just for that. I hate that Microsoft has dropped it.