3 ms·
> At some point you have to assume something is there and correct If you excel at compositional design then this may work OK but a lot of code bases I have wor
by bbcbasic 10y ago
> At some point you have to assume something is there and correct
If you excel at compositional design then this may work OK but a lot of code bases I have worked on just need a good ol' refactor to sort the mess out. And then the "there and correct" part could fail due to human error, or the new person not knowing the old assumptions etc. The asserts are a step in the right direction in documenting the assumptions though. Types go one level better by both documenting the interface, and enforcing that contract at compile time.