What is reactive programming?

Reactive programming is the concept of computer science that describes the properties of a computer programming language focused on automatic maintenance of the application as data used in the program change. One of the main features of the reactive programming language is that the declared and calculated variables are constantly re -evaluated as other variables used when the calculation is changed. This means that the language responds to changes in data, unlike using multiple imperative state commands, as many traditional programming languages ​​do. The theoretical result of the application using reactive programming philosophy would be a program that constantly and automatically changes the display or other factors based on changing data flowing into the program. Although several imperative programming models can be used to achieve the same results as reactive programming, the aim of creating a reactive language would be native support for reactive changes at a primitive level, a place at an object level.

One way to help clarify how reactive programming works is to compare it with imperative programming. When two numbers are added in an imperative language, the adding result is usually stored in a given memory location. The operation takes place when the command is made, and the result is separated from two numbers that have been added to create the sum. This means that if any of the two numbers that have been added after adding, the sum would not change because it is already stored in memory and separated from the original operands.

When the reactive programming language adds two variables to create the sum and one of the two variables changes at a certain point in the future, then the sum also changes. This means that the reactive program of the butternight to monitor the status of the data used and automatically respond to changes, potentially change the overall status of the entire application. In the imperative programmedThere are several models, including programming and observation data models based on events that can perform the same tasks by creating structures that monitor data changes, but the reactive language would have built -in mechanisms.

Use for a reactive programming language can be in areas in which the interpretation of any data streams is needed in real time. This could include scientific visualization, a graphical user interface (GUI) or even real -time communication in which the program is constantly changing on the basis of the received data current. However, it should be noted that there are no fully implemented, independent reactive programming languages. Most of the functional implementation of the concept is in the form of external libraries for traditional imperatively or functional languages.

IN OTHER LANGUAGES

Was this article helpful? Thanks for the feedback Thanks for the feedback

How can we help? How can we help?