re: Is “Defensive Programming” actually healthy? VIEW POST

re: I think it is valuable to not only think of defensive / anticipatory / forward thinking programming in terms of the code only, but to also think ab...

Interesting thought. I suppose the whole idea is that I don’t think we can ever know what the future holds. So how can we (as you say) “fail to a safe domain condition?” Because we don’t know what is safe for a case that we haven’t discovered yet. So for instance, the safest response is to stop. But if you stop at a blinking yellow, you might enrage the driver behind you who was expecting to pause. I’m sort of joking. But yes, I will meditate on what you’ve suggested. I think you might be on to something. :)


I had exactly the same thought when I saw the example, and can't stress enough how much I think this is a great approach

code of conduct - report abuse