DEV Community

Cover image for Sync and Async Made Simple!
Md Mahtab Uddin
Md Mahtab Uddin

Posted on

Sync and Async Made Simple!

Let's say you go to a restaurant. Waiter comes in and takes your order. As he goes to the kitchen, he waits till your order is ready. Then he brings your food & goes to another table ( meanwhile other tables are waiting to the order). That's call #synchronous.

Waiter takes your order to tje kitchen but doesn’t wait till It's ready. He come back to take other customers order. And Once your food is complete. He goes back & brings you the food. That's call #Asynchronous.

How does it works in programing?

Simply put, If a task is fast like loading a UI. It will be execute #synchronously.

And if it takes time, like downloading an image. It will be execute #asynchronously.

Top comments (0)