Content deleted Content added
removed a lot of jargon that disambiguated the articles introduction~~~~ Tag: Reverted |
m Rollback edit(s) by 50.92.202.47 (talk): non-constructive (RW 16.1) |
||
Line 3:
{{howto|date=March 2012}}
'''Defensive programming''' is
Defensive programming is an approach to improve software and [[source code]], in terms of:
* General quality – reducing the number of [[software bug]]s and problems.
* Making the source code comprehensible – the source code should be readable and understandable so it is approved in a [[code audit]].
* Making the software behave in a predictable manner despite unexpected inputs or user actions.
Overly defensive programming, however, may safeguard against errors that will never be encountered, thus incurring run-time and maintenance costs. There is also a risk that code traps prevent too many [[Exception handling|exceptions]], potentially resulting in unnoticed, incorrect results.
== Secure programming ==
{{main|Secure coding}}
Secure programming is the subset of defensive programming concerned with [[computer security]].
<syntaxhighlight lang="c">int risky_programming(char *input) {
|