Slashdot Mirror


Can Reactive Programming Handle Complexity?

Nerval's Lobster writes "A recent article on Reactive Programming, which suggested that five lines of Reactive could solve a problem that required 500 lines using Java or 200 lines using triggers, led many readers to question (passionately) whether Reactive enables you to address not just typical problems, but complex ones as well. In a follow-up column, Espresso Logic CTO Val Huber argues that, while it certainly can't solve all use cases, Reactive Programming is very capable of addressing many complex problems, and can address all other scenarios via a transparent integration with procedural languages. He shows how Reactive can handle complexity using two different scenarios: a classically complicated database application (a bill of materials price rollup) and procedural integration (to address external systems such as email and transactions not limited by a database update). Take a look at his work; do you agree?"

7 of 149 comments (clear)

  1. A few problems... by Ckwop · · Score: 5, Insightful

    A few problems:

    - What about circular reactions?
    - Is SQL really that right language for encoding business logic?
    - Triggers are kind of an anti-pattern.
    - What about atomicity? What if I need the whole reaction chain to work or none of it.

    I'm afraid there more questions than answers with this proposed pattern.

    1. Re:A few problems... by lgw · · Score: 5, Insightful

      - Triggers are kind of an anti-pattern.

      Well, sort of the point of this style is to embrace triggers as a powerful and underused tool. I'm a big fan of powerful and underused tools, but generally there's a reason they're underused.

      Pick the right tool for the job. Reactive programming seems like it makes life wonderfully easier for this very narrow set of problems. That's neat. But both trying to us it for everything and insisting that it's useless because it doesn't work for everything are mistakes. Like a power screwdriver with a U-joint attachment, some tools go from pointlessly awkward to awesomely helpful when faced with a particularly-shaped niche.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    2. Re:A few problems... by Qzukk · · Score: 5, Funny

      I think I just started development on the 3rd worst D20 product

      *rolls a 1*

      Your fingers fumble over the keyboard, striking keys almost under their own accord.

      UPDATE customer SET lastname='Jones'

      *rolls save vs. WHERE clause... 3*

      ;

      With horror you look on as you strike a glancing blow to the enter key.

      --
      If I have been able to see further than others, it is because I bought a pair of binoculars.
  2. of course it can by istartedi · · Score: 5, Insightful

    x = new WonderfulObject();
    x.Invoke("5000 lines of C that somebody wrote");

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    1. Re:of course it can by istartedi · · Score: 5, Insightful

      But if developers are constantly writing slight variations on the same 500 lines of C, why not encapsulate it?

      Sure, no problem with that. After all I just typed that into a text area in a web browser and hit send. There were probably *millions* of lines of encapsulated code in that one instant. The difference is that I'm not pretending that hitting "Submit" is the same as writing a web browser, a network stack, router firmware, etc. I didn't solve any problems. Those guys did.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  3. The usual consulting snake oil by engineerErrant · · Score: 5, Insightful

    As background, I am the director of engineering in a small Java/Postgres-based shop. We run a cloud backend for our mobile apps.

    This "methodology" reads from the first sentence like an extended infomercial for a consulting shop, or a company trying to create the aura of "thought leadership" to get more investment cash. The formula is simple and time-honored: (1) arbitrarily single out a well-worn software practice to receive a snappy marketing name and be held above all other practices, (2) claim it's new, and (3) offer to implement this bleeding-edge buzzword to clueless executives. For a small fee, of course. It's the same formula that gave us Agile.

    In my opinion, what they've described here is a large step *backward.* Not only is this a relatively trivial use of the GoF Observer pattern, but bizarrely, it's done in SQL using triggers, causing immediate database vendor lock-in and creating a maintainability nightmare. It's how software was made back in the 90s when Enterprise SQL database vendors ruled the land. Sprinkling business logic around in the SQL instead of centralizing it in a much more suitable language for logic like Java is a completely terrible idea, unless you're an Oracle sales rep.

    This one is safely ignored.

  4. Ditto by goombah99 · · Score: 5, Insightful

    I've done reactive programs. They make fun little interface gizmhos. But holy shit, try debugging something that does something complex. You can't assure when, where and how variables might be changing in some outer reaches of your program while another part of the program is assuming they are momentarily fixed. It's going to be unpossible to seriously optimize a reactive program.
    So yeah for silly data base queries of simple mathematical calcs go for it. Complex programs. run away

    --
    Some drink at the fountain of knowledge. Others just gargle.