Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6183985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:27:31+00:00 2026-05-24T01:27:31+00:00

What are the differences between Deferreds, Promises and Futures? Is there a generally approved

  • 0

What are the differences between Deferreds, Promises and Futures?
Is there a generally approved theory behind all these three?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:27:32+00:00Added an answer on May 24, 2026 at 1:27 am

    In light of apparent dislike for how I’ve attempted to answer the OP’s question. The literal answer is, a promise is something shared w/ other objects, while a deferred should be kept private. Primarily, a deferred (which generally extends Promise) can resolve itself, while a promise might not be able to do so.

    If you’re interested in the minutiae, then examine Promises/A+.


    So far as I’m aware, the overarching purpose is to improve clarity and loosen coupling through a standardized interface. See suggested reading from @jfriend00:

    Rather than directly passing callbacks to functions, something which
    can lead to tightly coupled interfaces, using promises allows one to
    separate concerns for code that is synchronous or asynchronous.

    Personally, I’ve found deferred especially useful when dealing with e.g. templates that are populated by asynchronous requests, loading scripts that have networks of dependencies, and providing user feedback to form data in a non-blocking manner.

    Indeed, compare the pure callback form of doing something after loading CodeMirror in JS mode asynchronously (apologies, I’ve not used jQuery in a while):

    /* assume getScript has signature like: function (path, callback, context) 
       and listens to onload && onreadystatechange */
    $(function () {
       getScript('path/to/CodeMirror', getJSMode);
    
       // onreadystate is not reliable for callback args.
       function getJSMode() {
           getScript('path/to/CodeMirror/mode/javascript/javascript.js', 
               ourAwesomeScript);
       };
    
       function ourAwesomeScript() {
           console.log("CodeMirror is awesome, but I'm too impatient.");
       };
    });
    

    To the promises formulated version (again, apologies, I’m not up to date on jQuery):

    /* Assume getScript returns a promise object */
    $(function () {
       $.when(
           getScript('path/to/CodeMirror'),
           getScript('path/to/CodeMirror/mode/javascript/javascript.js')
       ).then(function () {
           console.log("CodeMirror is awesome, but I'm too impatient.");
       });
    });
    

    Apologies for the semi-pseudo code, but I hope it makes the core idea somewhat clear. Basically, by returning a standardized promise, you can pass the promise around, thus allowing for more clear grouping.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any differences between these two covered indexes? A composite index with both
Are there differences between these two? replace(/[^a-z0-9]/gi, ''); replace(/[^a-zA-Z0-9]/g, ''); Also, are there any
What are the differences between these two, and which one should I use? string
Are there any important differences between declaring <script type=text/javascript> </script> and <script language=javascript> </script>
Are there any practical differences between special forms and macros? In what do they
What are the differences between these two prefixes in terms of HttpListener or any
Are there any differences between what in Common Lisp you'd call an atom, and
Are there any differences between boost::shared_ptr , std::tr1::shared_ptr and the upcoming (in C++0x )
What are the differences between all of the different types of SQL? I hear
Is there any differences between hibernate session and the session which you use while

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.