ELI5: Explain Like I'm 5

Promise

Okay kiddo, let’s talk about promises.

You know how when someone says they will do something, you expect them to do it right? Like when your friend says they will play with you tomorrow, you expect them to come and play with you tomorrow.

A promise is just like that. It’s when someone says they will do something and you expect them to do it. It’s a way to make sure the person keeps their word.

Now, to make sure that someone keeps their promise, we have something called a “promise” in computer programming.

In simple terms, a promise is just like making a deal. The computer makes a deal with you that it will do something when you ask it to do it. It’s like asking someone to help you with your homework and they promise to help you later.

But the neat thing is that a computer can make lots of promises at the same time. This way, it can keep working on other things while it waits for the first promise to be fulfilled.

For example, if you ask the computer to load a video while it’s still working on something else, it will promise to load the video as soon as it’s free. This way you can keep doing other things while it loads the video.

So, a promise is a computer’s way of making sure that it keeps its word, just like you keep your word when you make a promise to your friends.
Related topics others have asked about: