News for hackers. Stuff that matters.
Re:Sure-thing principle by taneq on Saturday May 26, 2018 @10:14PM (#17165147)
In this example the two "drive to airport" actions are different.

    If (volcano_status == GONNA_BLOW)
        pack_everything_and_run();
    else if (volcano_status == NO_WORRIES)
        pack_suitcase_and_leave_for_holiday();
    else if (volcano_status == UNKNOWN)
        cancel_holiday();
Re:Sure-thing principle by TezlaKoil on Sunday May 27, 2018 @12:17PM (#17167576)
It depends on what you treat as a complete action. One could equally well decompose it as two actions and two conditionals:

if (volcano_status == GONNA_BLOW) refuel_car(); else if (volcano_status == NO_WORRIES) refuel_car(); else if (volcano_status == UNKNONW) nop();

then later

if (volcano_status == GONNA_BLOW) pack_everything_and_run(); else if (volcano_status == NO_WORRIES) pack_suitcase_and_leave_for_holiday(); else if (volcano_status == UNKNONW) call_to_cancel_holiday();

Then refueling the car is definitely the same action, even if it's followed by different actions later on.