But why isn't jQuery 1.5 mentionned? See this: http://www.erichynds.com/jquery/using-deferreds-in-jquery/
Three Routes to Spaghetti-Free Javascript
11–18 of 18 posts
Re: Three Routes to Spaghetti-Free Javascript
#12Re: Three Routes to Spaghetti-Free Javascript
#13Route 2: Mobl, a compiles-to-Javascript language.
Route 3: Stratified.js, a compiles-to-Javascript language.
And then a side-mention for something actually in Javascript: https://github.com/caolan/async
So, to make spaghetti-free Javascript... don't write Javascript? I'll keep looking, thanks.
Re: Three Routes to Spaghetti-Free Javascript
#14Route 1: Streamline.js, a compiles-to-Javascript language. Route 2: Mobl, a compiles-to-Javascript language. Route 3: Stratified.js, a compiles-to-Javascript language. And then a side-mention for something actually in Javascript: https://github.com/caolan/async So, to make spaghetti-free Javascript... don't write Javascript? I'll keep looking, thanks.
Re: Three Routes to Spaghetti-Free Javascript
#15I've written a library for internal use (that I'm waiting for work to agree to open source) that basically lets you bundle a group of asynchronous calls into a single callback. I prefer this method because it doesn't try and hide the asynchronous nature of the code, it just frees you up from having to nest your callbacks N deep when you require the output from all N asynchronous operations to continue. Wondering what…
Re: Three Routes to Spaghetti-Free Javascript
#16Earlier quoted context omitted.
It's been done. One of the best libraries for managing asynchronous code in JS without hiding it away is http://github.com/caolan/async I agree wholeheartedly, by the way. There's way too much scope for leaky abstractions when you try to hide away the true nature of asynchronous code. Same reason, I think, why most people are lukewarm about using continuations in web development, like e.g. Seaside does: in principle,…
Yeah, I assumed there had to be libraries to do this already, but didn't come across anything that did what I wanted. I'll check out async though, thanks for the heads up.
I have a lot bookmarked on github, these are mostly libraries.
https://github.com/coolaj86/futures https://github.com/substack/node-seq https://github.com/marcuswestin/fun https://github.com/creationix/step https://github.com/chriso/chain.js https://github.com/substack/node-chainsaw https://github.com/caolan/async https://github.com/kriszyp/promised-io https://github.com/kriszyp/node-promise https://github.com/technoweenie/node-chain-gang https://github.com/creationix/do https://github.com/willconant/flow-js https://github.com/creationix/conductor
Some branches of CoffeeScript are also trying to ease the pain. Defer keyword didn't make it into CoffeeScript main. My impression is CoffeeScript makes callback hell less ugly anyway, so there is less need for adding a complex language feature that generates unreadable JavaScript.
Re: Three Routes to Spaghetti-Free Javascript
#17It depends on generators, so it works only in Firefox, but it's a cool hack nonetheless, and might be useful if you're developing Firefox addons.