5 ms·
If you think my code's checking carefully for the validity of the input makes it bloated and ugly, you just failed my interview.
by jerf 11y ago
If you think my code's checking carefully for the validity of the input makes it bloated and ugly, you just failed my interview.
- greenleafjacob 11y agoThere's a correct place for every class of input validation. The point is that you don't want multiple levels of input validation for the same thing. Most of what passes for "defensive coding" is superfluous. For example, if you are passing a pointer into a function, you don't need to reflexively null check. However, null checks are important.