• @fubo
    link
    51 year ago

    What worries me is that neither version handles any errors whatsoever.

    What happens if the oven never gets hot, because the gas interface has been brought down for maintenance? Now we’ve allocated a raw pizza that will never be baked. Since we never time out or check errors here, eventually the customer will time out waiting for a pizza and switch to our competitor.

    Are we really allocating a new oven for each pizza? Probably not; oven may be a singleton. In one case, it’s possible for the oven to fill up with pizzas and oven.Insert to fail; in the other case, it’s possible for the kitchen to fill up with ovens, and oven.New to fail. Lacking error checking, we’re eventually going to get one or another kind of oven overflow.

    What happens if order.kind is “fuck you”? We don’t put any toppings on the pizza; but (in code not shown) the value of order.kind probably still gets printed on the receipt. So some poor schmuck gets delivered a none pizza with fuck you. Like so many other Internet services, our pizza service can be exploited for harassment.