We had an exam and the question paper asked which of the following is not a defensive programming technique. I've answered it as print statement
, that a print statement is not a defensive programming technique
. I went back to school after 6 years of working as a programmer and I've not used print statements
anywhere in the production level code(I've used loggers at all levels, but the print statements here means Sys-out statements) and the professor argues that he uses print statements
in the code and hence it is a defensive programming technique(and the correct answer is encrypted object code
, and yeah I agree that is not a programming technique at all and hence not a defensive programming technique, but so is/are print statement/s
). I tried to show code bases of some open source projects on GitHub, but he wouldn't budge.
He is not open to discussion and hence I'm posting it here. He showed me an image from a book, I'm arguing that the defensive programming technique that is referred to in the book actually refers to if conditional
and not to print statements. Need a tie-breaker on this one as well.