News for hackers. Stuff that matters.
Re:Missing the Point of Promises by Evbn on Sunday October 21, 2012 @11:27PM (#4681726)
Promises go back several years in Java. Any use of asynchronous functions with callbacks is basically a Promise.
Re:Missing the Point of Promises by kevinpet on Sunday October 21, 2012 @11:59PM (#4681793)
No, it clearly isn't. A Future, from Java 5's concurrency libs is close, but it doesn't offer the chaining construction -- it only offers get. The most similar-looking code commonly used in Java is probably people who use Option (or Maybe for those who stole from Haskell instead) with a .transform.

I don't think there's as much a need for it in Java because I'm less likely to want to write defensive code in that way outside of the browser.

It looks like Play supplies F.Promise, which provides the same functionality with a different API. I do like the simplicity of the API in the JS promises. The something.transform(good, bad, progress) is very easy to understand from the start.

Re:Missing the Point of Promises by jbrechtel on Monday October 22, 2012 @06:03AM (#4682436)
I've never thought of the two mentioned monads (Promise and Option) as defensive. Option doesn't seem defensive because sometimes you need to represent the possibility that there is no value to be returned.

Could you elaborate on how it's defensive?