ELI5: Explain Like I'm 5

Callback (computer science)

When you talk to your friend on the phone, you might ask them to call you back later. When you say this, you're basically telling your friend that you don't want to wait on hold for them to talk to you. Instead, you want them to finish what they're doing and then call you back when they have time.

The same idea applies to computers! In computer science, a "callback" is when you ask a computer program to do something for you, but you don't want to wait around for it to finish. Instead, you want the program to "call you back" when it's done.

For example, let's say you're using a web browser to look at a webpage. When you click a button on the page, the browser might run a complicated program in the background to do something (like load more content onto the page). Instead of waiting for the program to finish, the browser might ask the program to "callback" to it later, once the program has finished running.

This way, the browser can continue to work on other things while it waits for the program to finish. When the program is done, it "calls back" to the browser to let it know that it's finished, and the browser can then continue to do whatever it was doing before.

Callbacks are a useful tool in computer programming because they allow programs to work more efficiently. Instead of having to wait around for a program to finish running, a program can ask the other program to call it back later, and then continue on with other tasks in the meantime.