Defensive programming for non technical people
When developers write code, they can apply different styles; today we talk of Defensive programming.
Defensive programming is a technique that often is used when developing software. It consists of adding extra code to check for errors and prevent them from happening.
In defensive programming, the focus is not only on developing the feature that we need but also on thinking about everything else that could go wrong while the code is executed.
Some common features of defensive programming are:
The basic concept of defensive programming is to try to reduce the possible bugs that could arise, validating and checking all the values and types of data we expect.
This should reduce the number of bugs in our code and, as a side goal, reduce the number of iterations needed before the end of the development.
Often bugs are due to wrong initial input or due to "assumption" at the implementation level taken by developers. Both of these cases should be avoided/reduced, thanks to defensive programming.
Obviously, it takes more time, but the overall quality of the code is much higher, and the written code will be more resilient to future changes.
This series of articles is dedicated to managers who are not technical but need a quick introduction to technical topics from various subjects to be more aware in their work.