I am reading the book Java Concurrency in Practice and getting a little bit confused with these terms:
- Pre condition
- Post condition
- Invariants
Can someone please explain me them (with an example, if it’s possible)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’ll have a lot of problems writing Java, especially multi-threaded code, if you can’t understand these simple ideas:
They’re all part of an idea called "programming by contract". It was invented by a guy named C.A.R. Hoare. Bertrand Meyer built an object oriented language called Eiffel around it. No one uses it much, but he had a day in the sun because of it.
Eiffel isn’t very popular. There are over four million questions on SO as I write this, but only 32 of them are tagged "eiffel".
Update: There were 11,966,392 question on SO on 29-Jun-2016. Only 92 of them were tagged "eiffel". The percentage of Eiffel questions is staying roughly constant at ~0.00077%.