Robust programming

Robust programming is a style of programming that focuses on handling unexpected stops and actions. It requires code to gracefully handle these terminations and actions by displaying specific error messages. These error messages make it easier for users to debug the program.


Paranoia: When creating software, programmers assume that users are willing to decipher their code. Programmers also assume that the code they write can fail or run incorrectly.  Stupidity – The programmer assumes that the user will try to enter incorrect, improper and ill-formed input.  Therefore, programmers can return intuitive and clear error messages to users without looking for error codes. The error message should be as accurate as possible without misleading the user, so that the problem can be easily solved.

Users of dangerous tools should not access libraries, data structures or data structure pointers.

This information must be hidden from the user so that the user does not accidentally modify it or introduce errors into the code. After correctly constructing these interfaces, users can use them without discovering the defects that modify the interfaces. The interface must have been implemented correctly so that the user does not need to make any changes. Therefore, users focus only on their own code.

Nothing will happen – many times the code will change and may lead to an “impossible” situation. Therefore, the impossible is considered very unlikely. Developers think about how to deal with highly unlikely cases and implement management accordingly.