11
lorentz
3y

The primary concept of reactive programming is great. The idea that things just naturally re-run when anything they rely on is changed is amazing. Really, I think it's the next step in programming language development and within a decade or two at least one of the top 5 programming languages will be built entirely on this principle.
BUT
Expecting every dependency to be used unconditionally is stupid. Code that checks everything it might need all the time even if a decision can be made from much less information is simply bad, inefficient code. If you want to build a list of dependencies automatically, you have to parse the source.
And I really hate that there are TONS of languages that either make the AST readable at runtime or ship with a very powerful preprocessor that could be used to analyse expressions and build dependency lists, but by its sheer popularity the language we're trying to knead into something it was never and still isn't meant to be is JavaScript.

Comments
  • 0
    Okay, apparently I'm really stupid.

    If, given a set of arguments N and a function f, f(N) only uses a certain subset N1 of the records, the result of the function cannot change until a value within N1 changes, even if based on the changed value the function may access a different subset this time.
  • 0
    @lbfalvy I mean, that would be the assumption anyway one would think
  • 1
    @besnn For pure functions it's always true, and reactive programming is only really interested in pure functions in the sense that it only cares about reevaluating them on changes to values it was told to track.
Add Comment