News for hackers. Stuff that matters.
Re:Syncify.js – Eliminates the need for callbacks in the bro... by Nemcue on Sunday May 10, 2015 @10:40AM (#9520038)
Why not use a Promise library instead?
Re:Syncify.js – Eliminates the need for callbacks in the bro... by dmak on Sunday May 10, 2015 @11:33AM (#9520193)
The idea is to improve code composition by creating synchronicity. With Promises, you generally have to return the promise and then attach a then method to do something which is contagious and creates tons of dependencies on promises.
Re:Syncify.js – Eliminates the need for callbacks in the bro... by onestone on Sunday May 10, 2015 @01:40PM (#9520642)
What you describe is the "old" way to use promises.

Instead, you can yield promises inside generator functions, or better yet use async/await with a transpiler. Both methods give you nice sync-looking code.

Re:Syncify.js – Eliminates the need for callbacks in the bro... by dmak on Tuesday May 19, 2015 @09:50PM (#9574249)
Good to know!
Re:Syncify.js – Eliminates the need for callbacks in the bro... by Nemcue on Sunday May 10, 2015 @12:34PM (#9520398)
> something which is contagious

I guess what you're trying to say is that once you adopt Promises a large portion of your code will have to be tailored to use it.

To which I respond: .. yes, so what? It's better than callbacks. And it's better than some "magic fairydust" that doesn't make it explicit that you're doing something async.

Re:Syncify.js – Eliminates the need for callbacks in the bro... by eagsalazar2 on Sunday May 10, 2015 @02:46PM (#9520887)
Promises are better than callbacks but far worse (in terms of complexity they create) that synchronous code. This might be fairy dust but it crushes promises for reducing developer cognitive load. Having said that I agree with the person who commented that async/await is a better way to go (although sadly not really an option in CS yet).
Re:Syncify.js – Eliminates the need for callbacks in the bro... by modarts on Sunday May 10, 2015 @09:19PM (#9522175)
Why would someone invest in Coffeescript at this point with ES6 + Babel being a highly viable option?
Re:Syncify.js – Eliminates the need for callbacks in the bro... by monsieurbanana on Sunday May 10, 2015 @06:36PM (#9521681)
Sorry could you explain what CS is? I can't think of anything besides computer science.
Re:Syncify.js – Eliminates the need for callbacks in the bro... by seeekr on Sunday May 10, 2015 @09:05PM (#9522140)
CoffeeScript! :-) One of those neat compiles-to-JS languages!

Edit: And the "problem" with async/await and CoffeeScript is that the former is currently available in various JS transpilers but you can't use one of those and CoffeeScript at the same time.

Re:Syncify.js – Eliminates the need for callbacks in the bro... by beejiu on Sunday May 10, 2015 @01:14PM (#9520556)
> once you adopt Promises a large portion of your code will have to be tailored to use it.

This isn't a necessity, since you can create a function which both returns a Promise and accepts a callback. Most Promise libraries make this easy to support, which makes it easy to introduce Promises into projects that already use callbacks, and vice-versa.

Re:Syncify.js – Eliminates the need for callbacks in the bro... by dmak on Sunday May 10, 2015 @01:05PM (#9520520)
Definitely better than callbacks, but debatable wether this solution or promises is better. I like both.