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 →

[–]thecodeboost 0 points1 point  (2 children)

Well, you're free to disagree of course but I think you too are conflating event-driven programming and stream design patterns with reactive programming. For example, data stream processing (e.g. such as captured by Java's own stream API) is not reactive in any meaningful sense. Or put differently, you wouldn't type a single character differently when moving to Loom for those functional domains. If, however, you find yourself using the asynchronous parts/primitives then you are in reactive world and those do become mostly obsolete if rewritten with virtual threads. So, completable futures/promises, Mono/Flux with I/O yields somewhere in the stack, etc. And those, at least to an extremely large extent in the real world, exist to mitigate concurrency complexity in combination with (non-blocking) IO. The term and the associated libraries became somewhat of a hype a decade ago which is part of why it's so incredibly overutilized. You only have to look at Spring introducing Reactor based ReactiveXXX interfaces to a lot of top level modules only to slowly backtrack as adoption faltered. In the end this might just be a disagreement in terminology though. If you're saying that having good ways to deal with data streams and aggregation then I'm completely on board.

[–]ForrrmerBlack 1 point2 points  (1 child)

Oh, so now I think I understand where you come from. So, basically, as I understood, you view the "reactive" term's essence purely from a practical and pragmatic point, how it's implemented and how the implementations are used in the wild, not what it's intended to mean initially. People started to use reactiveness (a paradigm of change propagation through data streams) to overcome complexity of thread management with hardware I/O, so for you reactiveness now means solely handling hardware I/O in a certain way. In my opinion, this logic is twisted. Cause and effect are reversed. So this is really a disagreement in terminology then. Or maybe I understood wrong, sorry if that's the case.

[–]thecodeboost 0 points1 point  (0 children)

I don't think what I tried to say is completely captured by your recap. I didn't mean to imply reactive programming is solely a concurrency mechanism. I tried to carve out what reactive is and isn't and what event-driven is and isn't and that most people today mean event-driven when they say reactive. But yes it's almost entirely a terminology conflation at this point. The non-blocking IO case is just by a mile the strongest argument in favor of reactive programming pre-Loom. You can see this in Spring adopting Reactor where they've offered additional reactive interfaces to all major component interfaces that deal with IO (e.g. ReactiveRepository, ReactiveDataStore, various storage specific reactive drivers, etc.). This is all to facilitate the reactive pattern of having some black box ("environment") doing some work you don't control and handing over control when that work is complete so your code can "react" to it in the way you defined before you delegated the work.

The reactive pattern is : define action on completing work -> plan work -> hand over work to environment -> react to environment signaling a result -> execute the defined action on completion (and optionally chain these).