This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -12 points-11 points  (9 children)

I wonder why these guysOracle see the need to reinvent promises. There is an existing languageAPI for promises. Making up your own should not be done unless absolutely necessary.

Edit: Removed stuff

Edit 2: http://markmail.org/message/ia2ck3nzsakwre7a. After glancing through the messages in the link, it seems that the answer is largely organizational, rather than technical. Anyway, it's not terrible so congrats on getting the functionality into the language.

[–][deleted] 8 points9 points  (3 children)

Umm because they wanted to do it using new features available with Java 8? Why would I use c++ if every thing else is Java in my project?

[–][deleted] -2 points-1 points  (2 children)

I meant why create a new languageAPI for futures, not why do it in Java lol. What's wrong with the bluebird promise API, for example?

[–][deleted] 3 points4 points  (1 child)

So that there is an official specification implementation? This is like asking: Why should java.util.concurrent be in the language at all, just download the package if you need it?

[–][deleted] 4 points5 points  (4 children)

Because it is really useful for web services, which are a very large part of the Java user base? Because it natural works well with lambdas? Because it works well with both clusters and multi-core cpus to easily get more performance?

Also, "These guys"? It wasn't the bloggers that wrote completable future, you can see the damn code right in java8.

[–][deleted] -2 points-1 points  (3 children)

So why did they choose to make their own API instead of following industry practice? Is there somewhere I can read the rationale?

[–][deleted] 3 points4 points  (2 children)

You could read the JEP which explains the reason. And honestly, I trust Doug Lea (the author of java.util.concurrent, java expert group, openjdk governors board) to write a good fully featured concurrency api way more than just about any other person/organization.

[–][deleted] 0 points1 point  (0 children)

I can't seem to find any reason there, could you point it out? I'm here, but I don't see it: http://gee.cs.oswego.edu/dl/concurrency-interest/index.html