Final answer:
The statement is true; it is essential for programs to implement input validation to ensure only properly formatted and expected data is processed, which enhances security and reliability.
Step-by-step explanation:
The statement that programs should be designed such that all input is inspected before it is processed and bad data is discarded is True. This is a fundamental concept in programming known as input validation. Proper input validation ensures that only expected and correctly formatted data is processed by the program. By doing so, it acts as a first line of defense against malicious data that could potentially lead to security vulnerabilities such as SQL injection, cross-site scripting (XSS), or buffer overflow attacks. Furthermore, input validation improves the robustness and reliability of the program by reducing the chances of unexpected errors during runtime, caused by incorrect data formats or types.
To perform input validation, a programmer defines the criteria for valid input, which may include data type, range, format, and length. Inputs that do not meet these criteria are rejected or sanitized before being processed. For example, if a program expects an integer input within a specific range, the input validation process would check that the provided input is indeed an integer and falls within the acceptable range.