5 ms·
Interesting point :) At some point you have to assume something is there and correct (e.g., you don't write tests to check whether the tests are there, also yo
by dmichulke 10y ago
Interesting point :)
At some point you have to assume something is there and correct (e.g., you don't write tests to check whether the tests are there, also you assume the testing tools work, ...).
In static languages you also assume the programmer set the right type for the function argument, so you might as well assume to have an assertion in the critical code of the functional languages.
- 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.