It is similar to the microbial defense, you can't protect from them unless you know that they exist and how can be defeated. Once that we have navigated to the old way, sailing near the coast, we need to trace a more detailed map. It is my personal preference going from the generic aspects to the particular ones, so let us start in this fashion. In this topic we will take care for the most generic problems. I mean NOT the most common but the ones that can be applied in a more independent form, or has the most common factor among different solutions.
Lets start at the basics about programs or information manipulation.
This has a hot point for attackers, and is that it can be asked any number of times until a valid data is detected. Typically used for variable length data such as e-mail addresses, URLs and postal addresses. One language that has embedded capabilities for secure programming is Perl. Because we are not perfect people and make mistakes we must protect the program, and the system, against us. This is not uncommon in all well established software factories the use of testing, running environments, etc.