this post was submitted on 15 Sep 2023
120 points (90.5% liked)
Programming
16781 readers
114 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities [email protected]
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
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 andoven.Insert
to fail; in the other case, it's possible for the kitchen to fill up with ovens, andoven.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 oforder.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.