5

As Reactive Programming model is perfectly suited to address the change propagation required for transaction processing, that is, when the server receives change (Insert, Update, or Delete) requests. The key approach borrows heavily from Domain Driven Design to provide declarative Domain Logic. But how does it differ from functional programming approach?

2
  • The Reactive Programming Coursera course started yesterday... you might be interested, so far it's fantastic. This topic was covered (though I'd have to re-check my notes for a suitable answer). Nov 5, 2013 at 19:30
  • @SamanthaKnotts Do you have any up-to-date references to RLP? Mar 10, 2021 at 9:44

2 Answers 2

4

From the referenced wikipedia page cited by your link, It can be said that functional approach is orthogonal to being reactive. From the wikipedia article follows that reactive programming can be integrated in several programming paradigms (like procedural, logic, OO or functional).

My understanding is that reactive programming is based on the concept of dataflow, meaning that variable can be built from other variables and their value is constantly updated from its "dependencies", much like what happens in a electronic spreadsheet.

So reactive programming is mostly about data and how data changes.

The functional programming model is essentially based upon the definition of functions and the composition of those to build higher level operations.

The logic programming model is based on logical statements (usually in the form of assertions or equations) and the composition of those. The program executes by finding data that satisfies the proposed logic. This is similar to using a rule engine.

Both approaches can be used to create reactive programs, which will lead to programs built upon different reasoning approach to solving a problem. This reflects on the building blocks offered by the language as can be seen reading the OP link.

2
  • Pagoda, if u have checked that reference, I am not sure about pruning & caching adjustments! Nov 6, 2013 at 7:43
  • Could you please explain exactly what are you not sure about?
    – pagoda_5b
    Nov 6, 2013 at 8:18
4

Functional programming is about well.. functions :) You're entire program corresponds to the application and reduction of functions. If you want to get back to its roots, functional programming is lambda calculus supplemented with whatever you like (types, records, concurrency, primitive data).

Notably, FP has no notion of "time". Functions are referentially transparent and it shouldn't matter when you evaluate them.

Reactive programming talks about different stuff, it focuses on "behaviors" and "events". behaviors are like variables that change all on their own, for example: In a GUI the value of a slider changes over time, we could model a slider with a behavior. We also talk about events, which are fired at discrete moments, this corresponds to a button, which a user might click.

Notice that these aren't mutually exclusive, but reactive programming is pretty much orthogonal to functional programming. You can model behaviors and events with functions, objects, logical relations, you name it! We've simply run out of buzzwords and are beginning to reuse them :)

1
  • Joz, u explained the concept of functional programming some how. But, i'm still look for the difference not what they both are? Nov 6, 2013 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.