2 ms·
I've actually seen code that is basically: if (! try_thing()) if (! try_thing_again()) if (! try_thing_a_third_time()) giv
by SoftTalker 4y ago
I've actually seen code that is basically:
if (! try_thing())
if (! try_thing_again())
if (! try_thing_a_third_time())
give_up();
... where the thing is something that should basically always work, and if it doesn't there's no good reason to expect that trying again will have a different result. The programmer who wrote this thought it was defensive coding and a good practice.