Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

Rami Sarieddine

Author
+ Follow
since Nov 02, 2014
Cows and Likes
Cows
Total received
5
In last 30 days
0
Total given
0
Likes
Total received
3
Received in last 30 days
0
Total given
13
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rami Sarieddine

doesn't Mozilla's documentation reflect their own adoption of JavaScript operations and standards ? W3Schools, will give him some quick glance and listing of functions which what he needed.
Hi Grey,
Great questions.
Regarding "what motivated this decision" there are alot of factors but mostly influenced by suggestions/requests from the technical community. I am not aware of what exactly triggered this. Now on the Promises/A+ spec, on the credits page https://promisesaplus.com/credits they note that Promises/A+ draws heavily from the following works, and the majority of credit goes to their authors: Promises/A proposal by Kris Zyp (@kriszyp), and UncommonJS Thenable Promises specification by Kris Kowal (@kriskowal).

Regarding alternatives to using Promises, Promises try to provide a standard for asynchronous programming in JavaScript. There are several ways to achieve asynchronous programming (all with pros/cons), callbacks is just one way. You have Events, Messaging, Finite State Machines.
Lastly, regarding Stack Traces, it depends on libraries (promises/implementations) you are using.
Also there is a great read on performance hits by promises, http://thanpol.as/javascript/promises-a-performance-hits-you-should-be-aware-of/
Hi Tim, to your point, the book addresses the existing libraries:
• Q.js: Developed by Kris Kowal and Domenic Denicola, it encompasses a full-featured promise library that includes adapters for Node.js and support for progress handlers. It can be downloaded from https://github.com/kriskowal/q.
• RSVP.js: Developed by Yehuda Katz, it features a very small and lightweight promise library. It can be downloaded from https://github.com/tildeio/rsvp.js.
• when.js: Developed by Brian Cavalier, it offers an intermediary library and includes functions to manage collections of eventual operations. It also features functions that expose the progress and cancellation handlers of a promise. It can be downloaded from https://github.com/cujojs/when.

The book also explains how to write your own libraries from scratch and walks through building a minimal library that exposes Promise's functionality.
Regarding the last question, the book focuses on client-side promises /
I hope that answers your questions. Thanks for dropping by.
Hi Rrohit. Here is a good starting point to learn about the JavaScript functions: http://www.w3schools.com/js/js_functions.asp
Hi Michael. Thank you for the question.
As you noted, nested callback gets to be more problematic once it grows in lines of code and depth of nesting. Promises give you a neat solution for that, by providing you a more readable and "debuggable" approach. In the book there are examples on how structure the new code written with promises and talks about the ways that are currently used to make the callback nesting better and how Promises stand out as a better solution.
Regarding Node.js, the book doesn't go there. But Promises are now actively used in Node.js.
Q library by Kris Kowal is the dominant promise implementation in node.js. There is also Promised-IO by Kris Zyp.
Happy reading
Thank you Folks for welcoming me. Good luck for the random posters See you in the forum