Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Thunderbird 140 "Eclipse". Parent comment
1. Validate input, expect all external input (both human and machine generated) to be completely bogus.
2. Fail fast and early. If something seems off, crash straight away, and do not expect things to magically repair itself at a later stage.
3. Use pre- and post-conditions where appropriate.
I'm not sure about the exact definitions of defensive programming, but static type checking, and possibly unit testing, might also be part of it.
There are no comments on this comment yet.
1. Validate input, expect all external input (both human and machine generated) to be completely bogus.
2. Fail fast and early. If something seems off, crash straight away, and do not expect things to magically repair itself at a later stage.
3. Use pre- and post-conditions where appropriate.
I'm not sure about the exact definitions of defensive programming, but static type checking, and possibly unit testing, might also be part of it.