You can figure out why something went wrong by looking at how much it’s like something else that went wrong some other time.
Computer Science, Case Western Reserve University
Well, I guess this isn’t anonymous anymore.
Even though I’m on the other side of the country, it still doesn’t seem right to me to eat maple syrup that comes out of anything other than a plastic jug with an outline of Michigan on it, and perhaps a return address label for the person who made it stuck on the side.
I think I just came up with a good analogy for explaining asynchronous operations to people who don’t program. What do you all think?
You are out at a nice Italian restaurant and you order spaghetti and a side of green beans.
If your server brings you spaghetti but forgets the green beans and has to go back to the kitchen, you can still start eating with what you have on the table, and you’ll get to the green beans when they come out.
If your server brings you spaghetti and green beans but forgets to bring the silverware, there’s not much you can do. You have to wait until you have the silverware. You are going to sit there and stare longingly at your food, which looks and smells amazing.
Fetching the green beans is asynchronous, and getting the silverware is synchronous. You can pretty much continue your meal as normal if the green beans aren’t there, and when they show up, you eat them. But you can’t do anything until you have the silverware.