3 ms·
Their advice seems to be "do not assume invariants on inputs". In which case you can only assume that your input is unescaped, right? If you could assume escap
by rtpg 10y ago
Their advice seems to be "do not assume invariants on inputs". In which case you can only assume that your input is unescaped, right?
If you could assume escaping, that means you're limiting your input, which seems to go against the advice from my reading.
I gave escaping as an example, but one of the primary ways to reduce bugs is to reduce the scope of possible inputs as much as possible (thus reducing the scope of output to manage).
The requirements are different depending on the use case, but for application-internal code, not relying on that means that so much more global knowledge about the project is necessary to work on it. And, of course, a greater possibility of mistakes (because your requirements are more vast)