in some cases, but in others they may believe in a kind of sympathetic magic [1][2]. the John Frum's don't march around with stick guns and uniforms "simply to facilitate the delivery of cargo"
in either cases it's still highly apropos to the engineering analogy.
did you (hypothetically) add an unnecessary statement because you observed "good" programs doing it and believed if you did the same your program would be better? or because you thought you were facilitating something that was needed to be done to support something that isn't needed or won't happen? to me these are two sides of the same coin.
i've seen these kind of things (these are quick examples of the top of my head, not the worst things by far):
const char *str = "hello\0"; // make sure it's null terminated
if (ptr != NULL) free(ptr); // don't free if not allocated
in either cases it's still highly apropos to the engineering analogy.
did you (hypothetically) add an unnecessary statement because you observed "good" programs doing it and believed if you did the same your program would be better? or because you thought you were facilitating something that was needed to be done to support something that isn't needed or won't happen? to me these are two sides of the same coin.
i've seen these kind of things (these are quick examples of the top of my head, not the worst things by far):
[1] https://en.wikipedia.org/wiki/Cargo_cult [2] https://nla.gov.au/nla.obj-322270499/view?partId=nla.obj-322...