markdown guide
 

for knowing Async you need to know one problem that exists while using computers or may I say programming computers.

The Processors are the fastest thing in the whole computer next to them are Cache and then RAM and then secondary storage. Tasks using secondary storage, calling to another server over the internet, doing something in the database are slow and they are collectively called I/O tasks.

I/O tasks are slow because calling to the server requires a lot of waiting time, storage devices are slow too. BUT JavaScript waits for nobody. That's why ASync Await was made. It's basically like saying "hey JavaScript this function will do some I/O tasks, so wait for the tasks that say you await.

If you understood that then great, see this video for digging more deep youtube.com/watch?v=9YkUCxvaLEk

Huh! my first ELI5 explanation. •ᴗ•

 

Sync is: saying "Good morning" and waiting for the person to reply.
Async is: writing a post-it saying "Good morning" and leaving on the person's desk.
You expect the response as a post-it in your desk as well.

Similar analogy for computing can be applied. When you want to call a method/function/procedure/endpoint or anything, you call it.
If the processing of that call is done in the same "concurrent unit" (aka process or thread) by the caller and the caller waits for the result to be finished, it's synchronous. Otherwise, it's asynchronous.

 

async holds water that usually comes from a4set

Classic DEV Post from Sep 13 '18

Algorithms and Data Structures in the 21st century

Understanding the real importance of deeply knowing classic algorithms and data structures in an age where all of them are given to you on a silver platter.

Roger Stach profile image
Web Developer located in Jakarta.

😓 Sore eyes?

dev.to now has a dark version (in public beta).

Go to the "misc" section of your settings and select night theme ❤️