問題文
Generated code that reads an uploaded file assumes the file always has the expected columns. Which request would have produced more robust code from the start?
選択肢
- Request the code and then add error handling in review, and a reviewer sees the failure cases more clearly than the person who wrote the request.
- Ask for defensive code that handles all possible errors, so the generated implementation covers every failure mode that could occur once the file arrives from a customer.
- Generate the code in a language with stricter typing, and a compiler that rejects mismatched types catches the missing columns at the same time.
- State the invalid inputs the code must handle and what it must do for each, so validation and error paths are part of the requirement.