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.
A couple of weeks ago, we noticed that our house had a fruit fly problem, and that they were all collecting in the topmost window of the house. For a day or two, we spent some time massacring fruit flies every evening.
Then a spider moved into the window. We consider our problem solved.