__Programming paradigms__ are a way to classify programming languages based on their features. Languages can be classified into multiple paradigms - wikipedia
Some paradigms are concerned mainly with implications for the execution model of the language, such as allowing Side effect (computer science), or whether the sequence of operations is defined by the execution model. Other paradigms are concerned mainly with the way that code is organized, such as grouping a code into units along with the state that is modified by the code. Yet others are concerned mainly with the style of syntax and grammar.
Common programming paradigms include:
# Imperative Imperative programming in which the programmer instructs the machine how to change its state: - procedural programming which groups instructions into procedures, - object-oriented programming which groups instructions together with the part of the state they operate on
# Declarative Declarative programming in which the programmer merely declares properties of the desired result, but not how to compute it: - functional programming in which the desired result is declared as the value of a series of function applications, - logic programming in which the desired result is declared as the answer to a question about a system of facts and rules, - mathematical optimization (mathematical programming) in which the desired result is declared as the solution of an optimisation problem
For example, languages that fall into the __imperative paradigm__ have two main features: they state the order in which operations occur, with constructs that explicitly control that order, and they allow side effects, in which state can be modified at one point in time, within one unit of code, and then later read at a different point in time inside a different unit of code.
The communication between the units of code is not explicit. Meanwhile, in __object-oriented__ programming, code is organized into __objects__ that contain state that is only modified by the code that is part of the object.
Most object-oriented languages are also imperative languages. In contrast, languages that fit the __declarative paradigm__ do not state the order in which to execute operations. Instead, they supply a number of operations that are available in the system, along with the conditions under which each is allowed to execute.
The implementation of the language's execution model tracks which operations are free to execute and chooses the order on its own. More at Comparison of multi-paradigm programming languages.
# Sections
# See also