3 ms·
Sanity checks are as much a message to the human reading the code, as they are a message to the compiler/runtime. As a slightly contrived example, assert(sizeo
by Retr0id 2y ago
Sanity checks are as much a message to the human reading the code, as they are a message to the compiler/runtime.
As a slightly contrived example, assert(sizeof(char) == 1) is true by definition and could be elided, but it might be a useful reminder to see it in the source, next to code that implicitly relies on this truth.