Comment by fnord77

7 hours ago

side question, which CS class(es) teach about invariants?

The well-known algorithms book Cormen et al. describes a lot of algorithms using loop invariants. I must say I never really liked this approach but I admit it makes things easier to reason about.