Every programming languages we are using at least enforces one type of programming paradigm. Paradigm means a programming style a particular language follows.

For example: think about different types of houses. Some made of woods, some made of blocks and bricks, some from metal even some build their houses using ice called igloo. People choose one or combinations of styles among these to structure their house. Likewise programming has different styles.

  • Languages which enforces any of the paradigm can be called as paradigm oriented languages
  • Now a days most of the languages supporting several types of paradigms. These type of languages are known as paradigm – neutral languages.

Lets first see the hierarchy of these styles, paradigms

You might have a question why we need to understand these paradigms. Lets think it by our previous example. We choose one of those construction styles which suites for our house design(house plan, structural design, cost, time to build…) and the environment where we going to build the house. Like wise some languages supports some design methods than others. So to understand this relation ship with software design and programming language we need to know about different programming paradigms.

First we see the differences among main three categories of these paradigms 

Imperative Functional Logic
Model which consist of step by step instructions or commands which changes the state of a system. Simpler and clean programming paradigm which was developed from the purest form of mathematical theory of functions. Style which uses basic facts and relations to extract knowledge from a given problem domain
Follows

“First do this and do that” concept

Follows

“Evaluate a function and use the result value for something”

Follows

“Answer the question by searching for solution”

Order is very important in this style All computations done by calling functions Based on axioms, inference rules and queries
It is an abstraction of how Von Neumann computers works Abstracts a single expression to hide the complexity of a function

Functions can be passed as parameters for another functions

Systematically search the set of facts to complete the program execution

Uses set of sentences with logical expressions

Also known Conventional languages, state-based languages, Statement based languages or Von Neumann languages  Also known as declarative Programming since it gives the problem domain and let the system to inference from the possible solutions.
FORTRAN, Algol, Pascal, Basic, C…. Common Lisp, Scheme, Racket, Erlang, OCaml Prolog, Datalog, ASP (Answer set Programming)

Sub Categories of Imperative Programming Paradigms 

  1. Procedural Programming :   Style where programmers divide/decompose the major computations into smaller computational steps. Here the operations can activate or call by other procedures when needed.
    • Series of well defined and structured set of command and functions which completes the computational task.
    • Example: Basic, C, Pascal, FORTRAN
  2. ADT (Abstraction data type) Programming: Style where the module or Unit of program is represented by a abstract data type.
    • Most commonly they are model of certain type of data structures or a complex method. Where the complexity it hidden from the user. Only the things user might need only made visible to the user
    • For example take a Stack. User will see only the operations command for pop, push, peek, Empty and full. Other than that how it works will be hidden from the user
  3. Module-Based Programming: This is a style where each functionality of a program will be separated into small independent and interchangeable modules. So whenever a specific functionality is needed it can be used by implementing.
    • Interfaces in java is a good example to understand the concept of the paradigm
  4. Object oriented programming: Style where each independent holistic entities are imagine as objects and classes are written to specific type of objects as their blue print.
    • Each object might have several states and behaviors which represented by the data and methods.
    • Java is a good example for OOP language
  5. Generic Programming: In this style generic (common modules without telling the data type) modules which may be instantiated when compile time or run time. Commonly used to create data structures like ArrayLists, Lists. Some functions also can be written with generic return types when needed.
    • These style cannot exist isolated. Sp often used with OOP or Funtional programming.