Re:Virtual Threads Arrive in JDK 21, Ushering a New Era of C...
by grishka on Wednesday April 12, 2023 @10:20PM
(#35550036)
The reason I dislike async/await is that the code doesn't clearly express what it actually does. I also dislike asynchronicity built directly into the language. It's just one more piece of context you have to keep track of, and the more context you need in your head to understand the code, the greater the potential for bugs, imo. It is good that Java forces one to explicitly write out their intentions.
I really like the approach Java has chosen: keep the language itself as dumb as possible, but add all the niceties to the standard library and runtime.
One could argue that automatic promise wrapping and an await keyword ends up giving you cleaner, more simple code (despite the coloring).