3 ms·
I think a better way of doing that is to create a test that fails in exactly that condition. You can then put documentation in that test, as that's what the de
by scott_w 14y ago
I think a better way of doing that is to create a test that fails in exactly that condition.
You can then put documentation in that test, as that's what the developer will look at first. You also get the bonus that, if someone finds a way to fix the function that causes that, then you can go back to possibly nicer code.
- user24 14y agoThat assumes TDD, but yes that would be a nice way of doing it.
- Evbn 14y agoReading tests is not TDD, it is basic due diligene when learning code. Eve still, skipping that, when the test fails, the rush coder will see the problem.
- Evbn 14y agoThis is one of the many uses for tests that too few people know.