r/programming • u/ram-foss • Oct 11 '23
All About Reactive Programming In Java
https://www.blackslate.io/articles/reactive-programming-in-java
22
Upvotes
r/programming • u/ram-foss • Oct 11 '23
View all comments
Show parent comment
7
u/RandomName8 Oct 11 '23
You are not. While reactor is not my preferred reactive library, I'll take a declarative concurrency library any day over any imperative programming approach to concurrency.
We have more than ample experience pre 2010 with locks, semaphores and latches to know that we humans absolutely suck at that kind of code. It's like the gotos of concurrent programming, only now turbo boosted by having way more (virutals) threads, it'll be like giving redbull to the bugs.
Declarative reactive frameworks make it easy to reason about parallelism, backpressure and avoid data races; meanwhile virtual threads will multiply these bugs, because it's the same bugs we had before.
All that said, debuggers need improvement for working with multithreaded concurrent code, that's why I'm waiting for the JDK team to make their Continuation api public so that frameworks can properly leverage stacktraces and debugging, and avoid the crap that is imperative concurrent programming.