timonkrebs / MemoizR

Declarative Structured Concurrency for C#
Apache License 2.0
106 stars 3 forks source link

comparing to RX.NET #33

Open luxl opened 8 months ago

luxl commented 8 months ago

feels like with reactive programming, is there any advantages over it?

timonkrebs commented 8 months ago

At the Moment:

If you have a reactivity graph you will eventally run into things like the Diamond Problem. These Problems are solved out of the box in MemoizR (Signal implementations in general) where as with all the ReactiveX implementations these problems are not trivial to solve.

MemoizR is built with async in mind from the start, RX.Net only added AsyncRx recently and it is not production ready as of now. Rx.Net preceeds async await and therefore is not optimized for the modern way of writing C#.

There are a lot more advantages, like automatic/no subscription handling and all the problems that get solved from that.

But the biggest advantages over RX.Net in my opinion are probably not quite objective. I think the code that results from using MemoizR is easier to read/maintain because it is a lot closer to the traditional structured programming concepts used in modern C#.

In the frontend space Signals seem to win over rxjs. But MemoizR is a lot more than just a Signal implementation. It adds Declarative Structured Concurrency and Signal Operators which make it a lot more comparable to ReactiveX than the Signal implementations we see in the FE space.

Evolution of Signals

With MemoizR you can start simple and add complexity only as you need it. And a lot of the complexities are handeled out of the box. In conclusion: There are a lot less foot guns on the way compared to RX.Net

timonkrebs commented 8 months ago

Big advantages come from features that will be possible to implement with MemoizR that do not fit into the ReactiveX model.

For example: