Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualAlpha_ProgDes

Posted 13 October 2012 - 08:13 PM

Now if the input of the binary search method is incorrect, you'd raise an exception. Or at most, use an assertion after trying to sort the collection to check if the sorting algorithm works.

Interesting. I've always wondered about pre-conditions and post-conditions for a method. I thought that something that you'd use assertions for. Whereas exceptions are to handle "unexpected" errors.

#1Alpha_ProgDes

Posted 13 October 2012 - 08:12 PM

@

Now if the input of the binary search method is incorrect, you'd raise an exception. Or at most, use an assertion after trying to sort the collection to check if the sorting algorithm works.

Interesting. I've always wondered about pre-conditions and post-conditions for a method. I thought that something that you'd use assertions for. Whereas exceptions are to handle "unexpected" errors.

PARTNERS