News for hackers. Stuff that matters.
Re:The Two Generals Problem by patrakov on Monday May 09, 2022 @10:20PM (#31322650)
The pseudocode for the flight + hotel saga is quite long and messy and I would not immediately recognize that this exhausts all the possibilities that might go wrong.

I am not sure here, but, instead of encoding the desired and actual states via "the current place in the program", maybe it would make sense to write this program as one big for-loop that looks at the desired state and the actual state (explicitly stored in the variables), then does exactly one step to move closer to the goal, and, based on the outcome, updates these variables? I.e. apply the transformation from https://en.wikipedia.org/wiki/Structured_program_theorem#Sin...

Re:The Two Generals Problem by rocqua on Tuesday May 10, 2022 @04:12AM (#31324714)
How will the for loop decide between "try to book both the hotel and the flight" and "try to cancel both the hotel and the flight"?
Re:The Two Generals Problem by patrakov on Tuesday May 10, 2022 @10:16PM (#31335109)
This will be kept in the desired_state variable.