- #1
in the rye
- 83
- 6
Hey all,
I'm currently taking data structures and algorithms.
We are running member functions that have preconditions (requirements for the function to work), and post-conditions (what the function guarantees will happen provided the preconditions are met). We are doing a "quick and dirty" way in that if the precondition fails, we quit the program entirely with an error message.
My question is are preconditions normally checked AFTER the method is called? The book doesn't specify.
Thanks.
I'm currently taking data structures and algorithms.
We are running member functions that have preconditions (requirements for the function to work), and post-conditions (what the function guarantees will happen provided the preconditions are met). We are doing a "quick and dirty" way in that if the precondition fails, we quit the program entirely with an error message.
My question is are preconditions normally checked AFTER the method is called? The book doesn't specify.
Thanks.