Asynchronous Programming - Reading Assignment


#121
  1. What is the difference between synchronous and asynchronous functions?

                  Synchronous functions run continuously until its completion, an *asynchronous* function can be started and then and the other processing can be completed while the first function is running.
    
  2. What is callback hell?

               Callback hell in JavaScript is when nested code is used to delay a function and the code becomes difficult to read or follow.  
    
  3. Which technique can help us solve callback hell?

                    In the browser, through the use of "promises" or browser triggers provided in  jQuery. Or, extending runtime using "Fibers" via Node.js.

#122
  1. What is the difference between synchronous and asynchronous functions?

A sync task involves executing one line of code or command or something like that and putting everything else on the website on hold till that code is executed. Async involves programming it so that allows the code to be paused for the time being and then resumed later on so that one execution sequence doesn’t hold up the entire set of code from running.

  1. What is callback hell?

Callback hell occurs when there are two many subfunctions so that it’s hard to tell what’s supposed to come first and what’s sync and what’s async.

  1. Which technique can help us solve callback hell?

You can either use Jquery library “promises” which are designed to solve callback issues, or if you’re using node.js utilize “fibers” to make the code look sync even when it’s async, even though it’s not. It’s about rewriting the code in a such a way so that it feels sync even it can’t be.


#123
  1. The difference between synchronous and asynchronous functions is, synchronous functions are executed one section of code at a time. Asynchronous functions can initiate one section of code and set it aside to be completed at a later time, and move on to another section of code.
  2. Callback hell is the amount of nested functions/sub levels inside a piece of code. More complex operations produce more levels and sub levels.
  3. One technique that can help us solve callback hell is called Promises. Its a built-in JQuery library that helps us chain callbacks and deal with errors.

#124
  1. What is the difference between synchronous and asynchronous functions?
    synchronous functions use the single-thread program in order to execute a function until its finished, while asynchronous functions permit multitasking, in a way that it runs the code and realease the single-thread from that call function, those functions will be calledback once they get a data response.
  2. What is callback hell? event running a nested function, this means that a function code could be running in differents levels functions inside of his process, making the code very complex to read and maintain.
  3. Which technique can help us solve callback hell?
    By using the jquery library “built-in promise” in order to deal and solve erros.

#125
  1. What is the difference between synchronous and asynchronous functions?
    Single-threaded step by step code execution is synchronous, parallel task managing, minimizing the waiting time by introducing the Ajax-Callback method is asynchronous function.

  2. What is callback hell?
    Considering the multi layered nested functions, the callback of main function will depend on call back of other functions.

  3. Which technique can help us solve callback hell?
    Extending the runtime or built in promises.


#126
  1. Synchronous function: It waits for the completion of each operation, only after which it performs the following operation.
    Asynchronous function: is a form of I / O processing that allows you to continue processing other tasks without waiting for the transfer to complete.
  2. Asynchronous JavaScript or JavaScript that uses callbacks is something that is difficult to understand intuitively. Мore complex operations have shape of the pyramid with levels and sub-levels, which is called - callback hell.
  3. In the browser, a common pattern to deal with excessive callbacks is to use promises. This is a special object that contains its state. Initially, pending (“waiting”), then - one of: fulfilled (“completed successfully”) or rejected (“completed with an error”).

#127
  1. Synchronous program dosn’t allow other function to start until the first one is finished.
    Asynchronous programs allow other functions to execute if the first function is taking some time to respond.
  2. Nesting of many functions to implement complex operations is known callback hell.
  3. Promises can be used to deal with callback hell.

#128
  1. What is the difference between synchronous and asynchronous functions? Synchronous functions execute one at a time, i.e. won’t jump to the next until the current is completed. Such is the case in single-threaded environment. Asynchronous functions are such that one can be initiated and put aside so the other function/s can start executing.
  2. What is callback hell? It is the requirement of multi-level nested functions to execute an operation.
  3. Which technique can help us solve callback hell? The use of promises is common in browsers, and jQuery ships with a built-in promise library. In Node.js, the approach is writing code that looks synchronous thru extension of runtime.

#129
  1. What is the difference between synchronous and asynchronous functions?
    Single threaded. Each one waiting for the next to run vs simultaneous execution.

  2. What is callback hell?
    A bunch of call backs in a row filling up a large section of code and becoming hard to read. Also relating to synchronous code having long load times.

  3. Which technique can help us solve callback hell?
    Asynchronous programming and promises.


#130
  1. What is the difference between synchronous and asynchronous functions?
    Sync function occurs one after another and not allow next function to execute before previous one is complete. Async allows next function to run in another thread before the previous function is completed.
  2. What is callback hell?
    A nested event handlers which allows code to become async. It make code harder to write, debug and maintain.
  3. Which technique can help us solve callback hell?
    We can use promises to resolve the problem. Promised help to deal with chained sync functions and allows us to do error handling.

#131
  1. What is the difference between synchronous and asynchronous functions?
  • A synchronous function occupies the JavaScript engine until the function is fully executed, which means that the program is blocked and no other functions can be executed in the meantime.
  • An asynchronous function can be initiated and then put aside until a later date, which means that the program is not blocked and can execute other functions before the first function is fully executed.
  1. What is callback hell?
  • A callback hell is when a program calls a function that calls an additional function within the initial function and then it continues to call more functions within the previous functions.
  1. Which technique can help us solve callback hell?
  • To solve a callback hell you can use promises or extend the runtime by writing code that looks synchronous.