“A philosophical and theoretical framework of a scientific college or discipline among that theories, laws, and generalizations and therefore the experiments performed in support of them area unit formulated”. this can be a paradigm consistent with Merriam-Webster’s desk dictionary. This begs the question of “What area unit the four sorts of programming language?”.
The four sorts of programing language are:
- Imperative
- Functional
- Logical
- Object-oriented
The Imperative programming paradigm
The Imperative programming paradigm was one in all the earliest ones to be developed, and it had been done therefore by exploitation machine-learning. It’s conjointly the premise of the total method of hardware implementation. This was confirmed by a broadcast journal by landowner back in 2009 that he clearly expressed that “In imperative programming, statements area unit directions at the native machine-level, and that they contain states and variables that time right to the memory.”
A lot of its deserves embody near to the machine – quick execution time and additional potency.
While, on the opposite hand, it’s weaknesses too. Its order sensitive and therefore the limitation of abstraction area unit the key weaknesses.
Here’s AN example of the Imperative programming paradigm:
int fact(int n) { int f = 1; while (n > 1) { f = f * n; n = n – 1; } return f; }
“Notice the assignment operator, the equals (=) sign. the worth location of the variable itself was keep in memory” (Wikibooks, 2016)

Imperative programming vs Declarative programming
The purposeful programming paradigm
Basically, this paradigm states that the programs area unit made by applying and composing solely functions. It’s additional of a declarative programming paradigm wherever functions area unit thought of as trees of expressions, and every one in all the returns a worth rather than a sequence of imperative statements – which might originally amendment the state of the program.
In purposeful programming, you’ll be able to image functions as fantabulous voters. This being aforesaid, they’ll be:
- Bound to names
- Passed as arguments
- Returned from different functions
More or less like every different information sort will.
There area unit cases wherever purposeful programming is treated as a equivalent word for strictly purposeful programming, that may be a set of purposeful programming that treats all functions as settled mathematical functions – or pure functions.
Here’s AN example of the purposeful programming paradigm:
Function FindAvg(int x, int y){ return ((x+y)/2);} Call to function will return an average without storage of value in memory

Characteristics of functional programming
The Logical programming paradigm
Logical programming is that the strategy of exploitation logic circuits so as to manage however facts and rules area unit expressed. the alternative of this would’ve been exploitation solely mathematical functions.
More typically than not, particularly in genetic and organic process programming, this approach shows a model of what goal to accomplish instead of the way to get it on.
And also, rather than a very structured management flow dictating once to execute and measure perform calls, the program’s logic rules area unit written as logical clauses.
Here’s however it works to relinquish a far better picture:
Each rule contains a head and a body with formalized logic, that would’ve been whole totally different during a mathematical relation. “Z is true (this is that the heading): if A1, A2, and A3 area unit all true (this is that the body)”.
Here’s AN example of the Logical programming paradigm
Brother(X,Y) /* X is the brother of Y */ :- /* if there are two people F and M for which*/ father(F,X), /* F is the father of X */ father(F,Y), /* and F is the father of Y */ mother(M,X), /* and M is the mother of X */ mother(M,Y), /* and M is the mother of Y */ male(X). /* and X is male */ “That is X is the brother of Y if they have the same father and mother and X is male.” (University of Birmingham, n.d)
The Object-oriented programming paradigm
Object-oriented programming, that is best referred to as OOP, may be a variety of programming wherever you outline the info variety of an information structure, and at the same time the kinds of operations which will be applied to the aforesaid organization.
This way, the info structure becomes AN object that has each the info and therefore the functions within. in addition, programmers produce relationships between objects. In AN example, AN object will inherit the characteristics of another object.
One of the most benefits of exploitation Object-oriented programming is that it permits you to make modules that don’t want sterilisation once a replacement variety of object is supplemental. you’ll be able to merely produce a latest object that inherits a great deal of its options from the prevailing object. This makes the total method of modifying a great deal easier than the remainder of the paradigms.
Here’s AN example of the Object-oriented programming paradigm:
public class Example{ private String name; public void setName(String n){name = n;}}Class Example has a method setname and a string n that is assigned to a variable name in memory.

Object-oriented programming visualized