logoalt Hacker News

AdieuToLogictoday at 4:27 AM0 repliesview on HN

> But knowing your pre-conditions an post-conditions for your isolated parts of your code is important.

Design-by-Contract[0] is a formalization of this concept and well worth considering when working in code using mutable types. In addition to pre/post conditions, DbC also reifies class invariants (which transcend method definitions).

0 - https://en.wikipedia.org/wiki/Design_by_contract