Slashdot Mirror


How Reactive Programming Differs From Procedural Programming

Nerval's Lobster writes "A recent post on Reactive Programming triggered discussions about what is and isn't considered Reactive Logic. In fact, many have already discovered that Reactive Programming can help improve quality and transparency, reduce programming time and decrease maintenance. But for others, it raises questions like: How does Reactive differ from conventional event-oriented programming? Isn't Reactive just another form of triggers? What kind of an improvement in coding can you expect using Reactive and why? So to help clear things up, columnist and Espresso Logic CTO Val Huber offers a real-life example that he claims will show the power and long-term advantages Reactive offers. 'In this scenario, we'll compare what it takes to implement business logic using Reactive Programming versus two different conventional procedural Programming models: Java with Hibernate and MySQL triggers,' he writes. 'In conclusion, Reactive appears to be a very promising technology for reducing delivery times, while improving system quality. And no doubt this discussion may raise other questions on extensibility and performance for Reactive Programming.' Do you agree?"

41 of 186 comments (clear)

  1. Marketing 101 by s.petry · · Score: 4, Insightful

    There really is no such thing, they just made up the term for attention. What he is describing might be called "tools" programming, but it's not new or different. I have written "Tools" in various languages for over 20 years. If they think they are going to market a few bucks with a "re-branding" program good for them. It worked for "Cloud" and I knew better then too.

    --

    -The wise argue that there are few absolutes, the fool argues that there are no probabilities.

    1. Re:Marketing 101 by Anonymous Coward · · Score: 5, Funny

      Here's a quote for your marketing:
      Q: How does reactive programming differ from procedural programming?
      A: People use procedural programming, they only talk about reactive programming.

    2. Re:Marketing 101 by sunderland56 · · Score: 4, Funny

      There really is no such thing,

      Of course there is - I've been reactive programming for years. My boss yells at me to do something, and I react.

    3. Re:Marketing 101 by s.petry · · Score: 3, Insightful

      I think it's supposed to be being touted as a special new language because we need "reactive" programming hence the name "Reactive". The language may be "new", but I doubt it. I have not looked honestly, I looked at the claim on why it's needed and call bullox. I have mountains of libraries I have written for various tools in C, Python, Perl, and various scripting languages (TCL/WISH/SH). Most of those use bits of the mountains of libraries developed for those languages.

      I'm getting cynical in my age I guess, but the majority of the claims people make are simply fluff to try and make a buck or name. Claiming that we need a new language for a special case is silly. Develop and release a library(or libraries) for your needs so that people can use it. Otherwise we end up with all these little tufts of crap that 3 people in the world use, and have to listen to them complain about why adoption is so low.

      --

      -The wise argue that there are few absolutes, the fool argues that there are no probabilities.

    4. Re:Marketing 101 by Bite+The+Pillow · · Score: 2

      You clearly don't understand.

      If you abstract the idea to a framework, and let the framework take care of the work, you have less programming to do.

      And if your framework is domain-specific enough that it can watch one column and update another with very simple rules, without injecting a custom validation layer, then you have it very easy.

      Your code base being 5 lines means that only 5 lines of code execute, and anything else that happens behind the scenes require no learning, support, fixing, bug reports, testing, or really any attention at all, because it works for your domain-specific problem.

      So, you have your "ordering" framework, one for "matching address rules to geographical locations" validation framework, your "content management system that uses plain text to deliver content" framework... oh, there is a framework for every need. That's how simple it is.

      And, NO ONE HAD TO WRITE THE FUCKING FRAMEWORK.

      That last part is the important one, it's how you achieve time to market and bug-free nature of the code. Just give up and believe.

  2. Does it handle dupes? by istartedi · · Score: 3, Informative

    How does RP handle dupes?

    I know I put in my $0.02 previously, so I won't bother again.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  3. All methodologies are the same. by hamster_nz · · Score: 5, Insightful

    1) The proactive, forward looking teams adopt it first, and have great success.

    2) The "emerging trend followers" hop on board, and have reasonable results.

    3) The rest of the industry follow and have mixed results, without it being any more successful than any other methodology.

    Don't be blinded - initial results always look very promising.

    Anybody around here remember Jackson Structured Programming The initial OOP wave? The whole CASE moevement? GUI application builders that were supposed to end the need for programmers?

    The golden rule is that "whatever methodology technology you choose, half of adopters will always get sub-average results". The question you have to ask yourself Is are your team smarter than the average team?

    1. Re:All methodologies are the same. by msobkow · · Score: 4, Insightful

      Absolutely.

      The longer you spend in programming, the more you realize it's all been done in years past and it's just some "new grad" thinking they've invented something because they never looked into the history of programming techniques used over the years, or because they never happened to touch the systems that did it before.

      I've been programming for over 35 years.

      I've come to the conclusion that it's all about marketting buzz-words and bullshit to try and sucker investors into spending money, not about actually improving the way people write code or think about problems.

      --
      I do not fail; I succeed at finding out what does not work.
    2. Re:All methodologies are the same. by hibiki_r · · Score: 4, Interesting

      Like every other question about software development, we should always start with The Mythical Man Month. In this case, the relevant chapter is There Is No Silver Bullet.

      Now, the interesting thing about that chapter is that, while it was right, it was the least right of all the good predictions Brooks made. No technology is a silver bullet, but many produce noticeable improvements that, when put together, can give us an order of magnitude in productivity over older tech. It's not as if OO has been abandoned. Case tools were replaced by the far more sensible powerful IDE. GUI builders are not used a lot nowadays, but we get many of their gains by having dev environments with tighter feedback loops. And there's of course the mother of all improvements, which is the creation of large, powerful libraries. How many of the things that people did for business applications 15 years ago are, today, just replaced by libraries?

      Not that this denies your final thesis though: Hire bright programmers with people skills, and do your best to keep them. No technology will allow bad developers to make a good application.

    3. Re:All methodologies are the same. by lgw · · Score: 4, Insightful

      The nice thing is after 10-15 year or so, all problems start to look familiar to you, but not so much to the young guys or the managers. You can either rebel against the latest old thing new again and seem a Luddite, or seem a genius for immediately seeing all the pitfalls and optimizations entailed in the "new" idea.

      --
      Socialism: a lie told by totalitarians and believed by fools.
  4. Woohoo by viperidaenz · · Score: 5, Insightful

    Yet another super awesome framework/system/language/whatever to make a shopping cart in as few lines as possible.

    The someone tries to build something remotely complex and it all falls to shit and the code ends up as spaghetti.
    The guy who built it then leaves the company and they can't find anyone else with the skills to understand how it works

  5. should've tried Twisted by smoothnorman · · Score: 2

    what it takes to implement business logic using Reactive Programming versus two different conventional procedural Programming models: Java with Hibernate and MySQL triggers,'

    ...Twisted/python is perhaps a more sensible established comparison for event-driven, or not. besides... "business logic"?

  6. A Day at the Country Fair by MightyMartian · · Score: 5, Funny

    Buzz words! Get your red hot buzzwords! These buzzwords are fresh folks! No one's even figured out what they mean yet! You snooze, you lose! You there, little boy, I bet you could use Web 3.0!

    --
    The world's burning. Moped Jesus spotted on I50. Details at 11.
    1. Re:A Day at the Country Fair by similar_name · · Score: 4, Funny

      I bet you could use Web 3.0!

      I'm going to wait for Web 3.11 for Workgroups.

  7. table based programming by phantomfive · · Score: 3, Interesting

    Isn't reactive programming essentially a repackaging of Table Oriented Programming?

    --
    "First they came for the slanderers and i said nothing."
    1. Re:table based programming by msobkow · · Score: 2

      Table-oriented programming strikes me as a fancy name for something much older: data driven programming. Control structures which are pre-defined as "tables" of data that get interpreted at run-time.

      --
      I do not fail; I succeed at finding out what does not work.
  8. functional by Lehk228 · · Score: 3, Interesting

    In imperative (procedural) programming, A=B+C is an assignment statement. A is set when the assignment statement executes. Subsequent changes to B or C do not affect A, unless you specifically re-calculate A. Software developers are responsible for understanding and managing these dependencies.

    Reactive programming is a declarative approach for defining logic. Variables are defined by expressions such as A=B+C, which automatically reacts to changes in B or C.

    this is just rebadged functional programming, except using deliberately confusing syntax

    --
    Snowden and Manning are heroes.
    1. Re:functional by bondsbw · · Score: 2

      Not entirely. Of course you can model A=B+C as a function A which, when evaluated, returns the sum of B and C. And sure, you can evaluate A() several times and get different results if B or C have changed.

      Reactive programming is about the future and expecting change. When B or C changes, notification of that change is pushed up to the eventual recipient.

      But it's more than just simple event handling. For example, what if you wrote a complex SQL query against a few dozen tables located on a hierarchy of servers that might only return a handful of joined records out of millions or billions? And what if that data rarely changes, but you need to know almost immediately? Polling would use too many resources, too much bandwidth, and may never give you the results in a timely manner. But if the system is reactive, the change starts at the leaf server and only gets propagated up its part of the server hierarchy to the final listener. And if that record is filtered out somewhere along the way? The remaining part of the server hierarchy (including the end listener) never has to know or worry about it.

      Still, reactive programming is a hammer but not everything is a nail. Use it when it helps.

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    2. Re:functional by lgw · · Score: 2

      Or, one could call it "push based, instead of pull based" if one were eschewing obfuscative nomenclature.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    3. Re:functional by VortexCortex · · Score: 2

      Not entirely. Of course you can model A=B+C as a function A which, when evaluated, returns the sum of B and C. And sure, you can evaluate A() several times and get different results if B or C have changed.

      Reactive programming is about the future and expecting change. When B or C changes, notification of that change is pushed up to the eventual recipient.

      So let me get this straight instead of polling the keyboard and mouse port constantly, with Reactive Programing we can just have them generate an interrupt which calls a handler and it calls functions which calls functions to propagate this state change event into other waiting batches of code until the end result is generated -- Updating a cursor location or activating keystroke command, etc. Wow, that's pretty revolutionary. Someone should invent the shit out of that so that the CPU can just sit on a HALT operation until something actually happens.

      Or we can just stick to calling it Event Driven Programming and be fucking done. The Controller updates the View when data in the Model changes? You don't say.

      But it's more than just simple event handling. For example, what if you wrote a complex SQL query against a few dozen tables located on a hierarchy of servers that might only return a handful of joined records out of millions or billions? And what if that data rarely changes, but you need to know almost immediately?

      Well in that case I just have the controller update a distributed data model that's broken down according to its views. The problem with pure reactive approach is that you can't efficiently run a SQL across the distributed data model unless you thought to prearrange the system for it -- If you did think ahead, then you didn't need reactive programming to accomplish it. If you use a purely Reactive Programming Language and platform then you'd still have to re-deploy the system every time you want to include a new query.

      That's why distributed DBs with replication already exist so that you can deliver, say, Google+ notifications to nearby friends in near real-time while allowing those not explicitly interested to search for the data later after the cached data replication occurs. See? Folks already thought about the bandwidth problem of the "reactive approach"... A Reactive Programming language essentially does the job of a network and database engineer, and you can bet it'll make some dumb assumptions unless these employees are maintaining the implementation of the back-end framework that exposes the event controller and data model to the RP language anyway (which seems to be the case in TFA). No real win over handing a data flow diagram to a couple of coders who will implement it anyway, except with a formalized language you've added another layer of abstraction and thus another layer of mystery between the programmer's desires and the end result -- "Let's put People in the Compiler! What can possibly go wrong?!"

      So, basically RP just not storing storing the data in a central location (Polling) and delivering the data as it arrives (Event Driven). Smalltalk and Squeak already exist, so it's not like we need a new language for calling functions in response to .onChange() -- No, you really should take a look at Squeak if you haven't already. I mean, I'm all for reinventing the wheel when needed, but can't we just rename Squeak to (re)Active++ Enterprise Edition and skip this headache?

  9. Toy Example by reluctantjoiner · · Score: 3, Interesting
    I'm trying not be as automatically dismissive as others, but this example isn't convincing. If your enterprise can be encapsulated by eleven use cases, any framework will suffice. But even in this toy example, we can some obvious missing things.

    For example, the "Purchase Order" entity includes a reference to a sales rep. From it's inclusion we infer that is important data, so it would also need to be added as a "reaction". There's also no hint on how these "reactions" are actually implemented. The original article claims that consistency is enforced but doesn't really explain why.

    The customer.balance Rx, specified for the place order use case, states that its value is the sum of the unpaid order totals. This expression is automatically reused over all transactions that use the field. So, the balance is increased if an order is added, decreased when it is deleted or paid, increased when you raise the quantity, and so forth. With imperative code, it is easy to overlook one of the use cases introducing âcorner caseâ(TM) design and coding errors. Reactive practically eliminates this class of error.

    The above might be what they mean, but that's not sufficient for consistency. If your database field is merely a duplicate of derived data in other entities, you shouldn't pat yourself on the back for avoiding a problem you created in the first place! You can also overlook a use case in the analysis phase too, and then you'll fail to include it regardless of the framework.

    I think I'd like to see an example with all the entities included and some normalisation. Then maybe I might be convinced that RP has any advantages over triggers.

  10. Re:History repeats by jc42 · · Score: 4, Interesting

    We used to make websites by regenerate all html pages when the database changes. It delivers really fast then.

    Yeah, that's "reactive programming" at the file level. I do it all the time, with Makefiles. Lots of people do. A nice thing about a Makefile is that you can easily control when the calculation of derivative files happens. You (re)create some sets of primary data, then use a simple "make" command to rebuild everything that depends on any of them.

    This is yet another illustration that the perps who introduced this supposedly-new concept have mostly just found a new buzzword for an approach that has been reinvented repeatedly in the past.

    One of the ongoing problems in many fields of science and technology is the constant rediscovery (or reinvention if you prefer) of concepts long known by others that just use different words for the concepts.

    Actually, mathematicians long ago realized this, and have a standard term for things that are described differently but are actually identical: They're generally called "isomorphic". A classical example that's important in computers was George Boole's "Boolean algebra", invented primarily as an exercise in pure logic. Eventually people noticed that it was isomorphic to the "propositional calculus", and then as electricity became widely available, engineers found that their new "circuit switching calculus" was another isomorphism. That's why so many programming languages have those AND, OR, XOR, NOT, etc operators.

    This crowd is merely giving us another entry in the rather long list of isomorphic systems that differ only in their terminology. This means time wasted re-developing your system from scratch, when you could have saved a lot of time if you'd only realized that others had already solved your problem for you. But we don't have a good way to discover that two systems described with different words really are the same thing.

    (Or do we? Maybe some mathematical linguists are working on the problem right now, and we don't realize this because we don't recognize their terminology.)

    --
    Those who do study history are doomed to stand helplessly by while everyone else repeats it.
  11. what "Reactive Programming" really is by Gravis+Zero · · Score: 3, Informative

    from what i've read on wikipedia, "Reactive Programming" is really just function as a variable with caching.

    example:

    c = 5
    b = 4
    a = b + c
    print(a) // outputs 9
    c = 6
    print(a) // outputs 10

    this isnt rocket surgery

    --
    Anons need not reply. Questions end with a question mark.
    1. Re:what "Reactive Programming" really is by Prien715 · · Score: 4, Funny

      from what i've read on wikipedia, "Reactive Programming" is really just function as a variable with caching.

      example:

      c = 5
      b = 4
      a = b + c
      print(a) // outputs 9
      c = 6
      print(a) // outputs 10

      this isnt rocket surgery

      c=a + b ...behold the infinite loop is born!

      --
      -- Political fascism requires a Fuhrer.
  12. Spreadsheets are lousy programming models by putaro · · Score: 5, Interesting

    Their presentation makes analogies between "reactive programming" and spreadsheets and specifically references the power of "chaining" to have multiple functions firing as the result of changes.

    There are a number of issues with this kind of event chaining that you run into as you get past the toy cases.

    1) Fan-out. How many actions are being kicked off by a simple change?
    2) Latency - this is a direct corollary to the fanout. Are all of the chained functions being run synchronously? If so, what happens when someone introduces a very slow function that gets run as the result of a user input. So the user changes the price of a part and every purchase order in the system is suddenly being updated?
    3) Synchronicity - of course, as soon as you find out that your synchronously run chained functions slow things down you start running them in the background. Now, you have a problem where you don't know if something is up-to-date or not. And, in this model, it's not possible to find out if something is up-to-date.

    The examples that they gave are very poor use cases for triggers even. Most general ledger systems I've looked at, running on top of a database, would just recalculate the balance on demand. If your database is large enough that the recalculation starts to take significant time, you cache the result and invalidate it using a trigger. Most GL systems typically make entries much more frequently than they need to calculate the balance for an account. If the recalculation of the balance takes significant time, you probably don't want to do it every time an entry is made anyhow.

    1. Re:Spreadsheets are lousy programming models by Capt.Albatross · · Score: 2

      I was about to add 4) Unstable cycles - the formula your program represents may not be satisfiable, in which case it can never settle down to a consistent set of values.

      If that is the case, however, then either your problem is not solvable or your model of it is faulty, and the program implementing it would be wrong whether it used reactive programming or not.

      This suggests a partial solution to the synchronicity problem: whenever the event queue is empty, you have a consistent solution. This is OK for spreadsheets, but it seems to raise problems for a multiuser database with concurrent updates.

  13. Horseshit. by pigiron · · Score: 3, Insightful

    Stored procedures and triggers are already here and I see no evidence that there is anything new here. If the database is in a correct normalized form this will not reduce the amount of code one iota.

    Do ***NOT*** put this sort of logic in the application code. Use properly written stored procedures, foreign key constraints, and database triggers and don't let "application" programmers (especially not agile ones or those who invent new terminology for well known and previously solved problems) within 100 miles of the logic.

    And as far as the users being able to understand it "better" I have only one word to say: Bwahahahahahahahahahaha!

  14. Re:History repeats by jythie · · Score: 2

    Given how much anti-education rhetoric combined with fads and agism I see in technology, it seems like tech is worse then most fields about reinventing the past. There seems to be an almost pathological desire to not acknowledge when something is a revisit of an older idea. Maybe too much ego wrapped up in being original?

  15. Re:History repeats by stoborrobots · · Score: 2, Interesting

    Yeah, that's "reactive programming" at the file level. I do it all the time, with Makefiles. Lots of people do. A nice thing about a Makefile is that you can easily control when the calculation of derivative files happens. You (re)create some sets of primary data, then use a simple "make" command to rebuild everything that depends on any of them.

    You've hit it exactly - they've "invented" Makefiles for database rows.

    In a sense, that didn't exist before, so that's something new, and it's definitely simpler than writing the 200 lines of code to do what make would automatically do for you.

    I'm not sold on it taking over the world, but it's an interesting application of the idea.

    (Well, actually, it did exist before - they point out the example of a spreadsheet, which does exactly what they're talking about. This seems to be the answer to "why can't we program databases the same way we do spreadsheets and Makefiles?")

  16. Re:I thought that we were supposed to be pro-activ by bondsbw · · Score: 3, Informative

    Ok, there are a lot of people commenting on this below who have absolutely no idea what reactive programming is about. So I'll try to clear it up a bit.

    Reactive programming is not polling.

    If you call a function and wait for it to return a result, you aren't doing reactive programming.

    If you are working in a REPL or command-line environment, and you have to type a command every time you want to obtain a result, your system is not reactive.

    Reactive programming is not events and triggers. Well... let's say it this way: reactive programming is to events/triggers as writing in [C/C++/Java/C#/Haskell/etc.] is to writing in assembly. In other words, you really could do the same exact thing with events or triggers than you can do with reactive programming. But events and triggers are very basic compared to what is meant by reactive programming.

    Events and triggers are typically used when a little reactivity is needed. When you build your system around reactivity, using events and triggers quickly becomes inefficient and you need something built for the task. You would pick a reactive programming language or framework for such a complex job, just like (most of) you would choose high-level languages and frameworks over assembly for building a social media website.

    Reactive programming isn't an agile framework. It's not some new way of describing object-oriented programming. And it's not the right tool for every job, but for some jobs, it's the perfect tool.

    --
    All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
  17. Re: I thought that we were supposed to be pro-acti by KramberryKoncerto · · Score: 2

    Just like OOP eventually breaks down into CPU instructions, and you can use any Turing complete language to implement anything, I think he has a fair point. It sounds like a way to design a language so that complex event/trigger type stuff are easier to implement and debug systematically, perhaps using a slightly different way of thinking. It might not be a fancy thing, but I don't think there's anything wrong about giving it a name.

  18. Re:I thought that we were supposed to be pro-activ by bondsbw · · Score: 2

    Don't kid yourself that it isn't fundamentally a style implemented with events.

    I suppose that's why I said:

    ... you really could do the same exact thing with events or triggers than you can do with reactive programming. But events and triggers are very basic compared to what is meant by reactive programming.

    --
    All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
  19. This is absolute bullshit. by vikingpower · · Score: 2

    I don't know Val Huber, but can judge his "technology" ( hardly worth that name, though ) by what he is doing: putting the logic of a server-side application inside an RDBMS. After years and years of Hibernate applications with abysmally bad mainainability, now that finally finally finally-thank-god there are mature no-SQL databases, this guy goes back to where we were in the 80s.

    Moreover: comments on that article simply get suppressed. Which says enough about this guy's capability to sustain critical thought. Dupe. Total dupe.

    --
    Religous speak to God. Insane are spoken to by God. When all shut up, one can finally hear Shostakovich in peace
  20. Re:History repeats by Garridan · · Score: 2

    When would I find time to read when I'm already so busy inventing?

  21. Re:I thought that we were supposed to be pro-activ by serviscope_minor · · Score: 2

    ... you really could do the same exact thing with events or triggers than you can do with reactive programming. But events and triggers are very basic compared to what is meant by reactive programming.

    I kind of get the diretion you're going in, but I stil don't see. can you give an example? I see your analogy about C++ versus assembly but I only really understand it because I nuderstand C++.

    Presumably reactive programm automates some (how/what?) or many or most of the difficulties away...

    --
    SJW n. One who posts facts.
  22. Is it webscale? by Hognoxious · · Score: 4, Insightful

    You've told us what it isn't. That's as much use as telling us that strawberries are not yellow and curved.

    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  23. Re:I thought that we were supposed to be pro-activ by metamarmoset · · Score: 5, Informative

    The point of new paradigms in programming languages is to make the complexity of the expression match the complexity of the idea being expressed, not the complexity of the (platform specific) implementation.

    Crappy illustration:

    C++ - Event-trigger
    vector triggers;

    void add_trigger(Trigger * t);

    void reactive_variable::modify_value(int new_value)
    {
    // event
    this.value = new_value;
    // trigger
    for (i = triggers.begin(); i != triggers.end(); i++){
    i.react(new_value);
    }
    }

    // actual code you want to get around to actually writing
    int main()
    {
    reactive_variable a;
    Trigger *b = new Trigger(COPY_VAR);
    a.add_trigger(b);
    Trigger *c = new Trigger(ADD_VAR, 1);
    a.add_trigger(c);

    a.modify_value(2);

    enter_event_loop(); // some routine that modifies a continuously

    return 0;
    }

    Incomplete, inelegant and probably buggy, but you get the picture.

    Verilog - Reactive
    assign b = a;
    assign c = a+1;

    inital a = 2;

    always @(posedge clk)
    a = count(input);

    Easy to understand whats going on and spot errors. 'b' will always equal 'a' and 'c' will always be one more.

  24. Reactive Programming = COME FROM label by 140Mandak262Jamuna · · Score: 2
    We all know how bad GOTO statement is and why that is the root of all evil.

    Reactive programming is based on the totally opposite concept of COME FROM statement. Waiting for a future Dijkstra to write a paper on how evil COME FROM is.

    --
    sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
  25. Been there broke that by FaytLeingod · · Score: 2

    There was once a language called magic that allowed this to be done and was really good at it. A bank wrote their system with it. Then 5 years later someone tried to re-write the banking app. 10 years later they're still reverse engineering the original app to provide the functionality.

    --
    as it is eaten so it shall pass
  26. Re:I thought that we were supposed to be pro-activ by ZahrGnosis · · Score: 2

    The downside of reactive programming, however, is exactly the same as the downside of the event/trigger logic that has been available in databases for decades, namely the difficult-to-trace side-effects caused by out-of-order execution that is basically mandated in reactive programming.

    It's not so obvious when you're first writing code, but it's a headache when you're maintaining it (I disagree with the article on this point). Take the example in the original article... let's say you go back and add a requirement that people can pay for multiple invoices at once or for partial amounts. You have to check every single trigger to see if it refers back to the original payment information and adjust it accordingly. You'll have to change the data model to handle partially paid components (currently "paid" is a boolean), and any trigger that reads or modifies "paid" will have to be adjusted.

    This alone isn't a problem -- you'd have to make similar changes in OOP, procedural, or functional languages... the issue is that in those languages you're more likely to be able to trace the dependant code and understand the flow. If you have access to the entire code base, you could search it I suppose, but each trigger operates like a "COME FROM" command in INTERCAL... it's as if your code is running along operating and all of a sudden an execution branch just pops in, performs some change, and lets you carry on, without telling you. I've had to debug some brutal issues caused by this sort of programming and it's difficult precisely because you're not sure where the execution path is coming from nor in what order it's being executed. It's almost entirely un-auditable once it gets complex enough to perform real-world tasks. If this was a real-world billing system, you'd have payments, refunds, discounts, credits, and a dozen other bits each making each "reaction" more complex. Each would require its own line of reactive code and each would depend on at least several of the others, and it's very easy to lose track of what's going on.

    I realize people can write bad code in any paradigm, but bad code in reactive is far more difficult to debug, fix, and maintain, IMHO.

  27. Exploiting ambiguity to latch onto hype by REggert · · Score: 2

    I don't know why people keep submitting this garbage from Espresso Logic, who is just taking advantage of the fact the the term "reactive" has been overloaded to mean different things to exploit the hype surrounding the Reactive Manifesto and related technologies (e.g., Akka, Rx, Node.js, etc.) to push their own, completely unrelated product, which is based on the more traditional (i.e., the one you find in Wikipedia) definition of "Reactive Programming".

    "Reactive programming", as defined by the Reactive Manifesto (which is what all the hype is about), is about designing applications that operate in an entirely asynchronous and non-blocking manner, so as to maximize CPU utilization and fully exploit parallelism, and ensure that the system is always responsive to new events (user input, incoming data streams, errors, changes in load, etc.) rather than having resources tied up waiting for external processes (e.g., blocking on I/O). It has nothing to do with "reactive databases".

    --

    cp /dev/zero ~/signature.txt