Hacker News new | ask | show | jobs
by pkaler 1053 days ago
> Dumb question, what are invariants?

The term that you want to Google or ask ChatGPT is "Design By Contract". An invariant is something that is true during the lifecycle of a class, function, loop, service, system, etc. Invariants, preconditions, and postconditions are the three primary constructs in DbC.

1 comments

Thanks. I asked ChatGPT about the relationship between invariants and Design by Contract: https://chat.openai.com/share/dd2313ac-6088-455c-9d03-01795e...