3 ms·
Abstraction is, by definition, reducing different things to a shared subset of their attributes. Eg : the concept of "Human" is an abstraction over all the dif
by bsaul 9y ago
Abstraction is, by definition, reducing different things to a shared subset of their attributes.
Eg : the concept of "Human" is an abstraction over all the different attributes of all the individuals, to reduce them to the ones they all share. If i say i met a "human being", you can't tell if it's a "he" or a "she", if he has dark of blond hair, etc. What you can tell, is that it has a heart and a brain, stand on at most two legs, and has at most two arms. That could be all you need to deduce a few things, but by saying so, i kept some details hidden from you.
Now, if we get back to rx, its whole purpose is to work with the concept of "streams of events". Noting that many data structure and patterns (such as iterators over arrays, or event source observation) can be thought a specific kind of even streams.
This lets you define stream-combination operations, that work on all those structure. Which may, sometimes, be convenient.
The problem is when people start telling you that the generic tools around Rx Stream (producer, consumer, publish subject, etc) are the best tools to model the behavior of all your application, because "everything is in fact one big giant stream of events".
And then you end up with code monstruosities, because you realize that it's more complicated than that. Maintaining a UI state and mutating it becomes a nightmare, you start wrapping every native structures (such as arrays) into Observers just to perform the equivalent of a join, etc.
Either the stdlib and frameworks are "reactive", and then using rx pattern would be invisible, or you're going to have a horrible code.
In some way, it's exactly like generics, or base superclass : you define them in the stdlib, for example to share code between Sets and Arrays, but what the end user is manipulating 99% of the time isn't "Iterable". It's Arrays and Sets.
- CuriousSkeptic 9y agoThe problem is that Rx isn’t about “streams of events”. The main interface, IObservable, is entirely about _subscribing_ to “streams of events”. It’s the awful brittleness of handling those subscriptions that makes it so hard to program with. Compare that to something like signals in Elm (originally, it has changed now) while it makes some things Rx allow you to do impossible reports from users are that once it type checks “it just works”
- breatheoften 9y agoAn interesting podcast on the topic where the creator of elm discusses the creation (and removal) of signals in elm. https://overcast.fm/+HSqxOglhQ/17:21 https://overcast.fm/+HSqxOglhQ/17:21
- flor1s 9y agoSignals have been part of FRP since the first papers about it were published twenty years ago (about FRAN)