What are invariants, how can they be used, and have you ever used it in your program?
Posted
by
gablin
on Programmers
See other posts from Programmers
or by gablin
Published on 2010-12-30T21:19:20Z
Indexed on
2010/12/30
22:00 UTC
Read the original article
Hit count: 226
programming
|invariants
I'm reading Coders at Work, and in it there's a lot of talk about invariants. As far as I've understood it, an invariant is a condition which holds both before and after an expression. They're, among other things, useful in proving that loop is correct, if I remember my Logic course correctly.
Is my description correct, or have I missed something? Have you ever used them in your program? And if so, how did they benefit?
© Programmers or respective owner