What is declarative programming

Declarative programming: when the what is more important than the how

The declarative style of programming is used in a variety of cases today, albeit not in its pure form. However, the approach is not suitable for every application.

The declarative code is characterized by a high level of abstraction out. This allows developers to display complex programs in a compressed form. But the larger the application, the greater the risk that the code will be nested in such a way that it can only be read by the developer who originally wrote it. For companies that want applications to be maintained and further developed independently of people, this situation harbors a risk. Third-party developers then have to laboriously read their declarative code until they understand the structure and solve problems.

However, the level of abstraction of declarative programming also offers advantages. Since the execution is clearly separated from the system via an algorithm, the Perform maintenance independently of application development. Disruptions in day-to-day operations are reduced to a minimum. At the same time, optimization is easier because the algorithm used is open enough to access new methods. The disadvantage of using algorithms: Such a formulaic solution can often only insufficiently address specific characteristics of individual applications.

Not a disadvantage, but one The challenge lies in the thought model of declarative programming. Thinking in solution states is contrary to the natural human thinking behavior. People think in processes towards a goal instead of starting backwards from a goal. This requires developers to rethink and familiarize themselves with things, which can initially slow down problem solving. But once the new mindset has been trained, the declarative approach can show its strengths.

Developing from the problem description also has the advantage that teams can sketch solution models very quickly. Finally, the specific programming of the execution can take place in a later step. This is the declarative style for Prototyping well suited in agile software development.