Major Programming Paradigms

Courtesy: Kurt Nørmark (Department of Computer Science, Aalborg University)

1. Imperative paradigm (procedural)

First do this and next do that

Characteristics:

  • Discipline and idea
    • Digital hardware technology and the ideas of Von Neumann
  • Incremental change of the program state as a function of time.
  • Execution of computational steps in an order governed by control structures
  • We call the steps for commands
  • Straightforward abstractions of the way a traditional Von Neumann computer works
  • Similar to descriptions of everyday routines, such as food recipes and car repair
  • Typical commands offered by imperative languages Assignment, IO, procedure calls
  • Language representatives Fortran, Algol, Pascal, Basic, C
  • The natural abstraction is the procedure
  • Abstracts one or more actions to a procedure, which can be called as a single command.

2. Functional paradigm

Evaluate an expression and use the resulting value for something

Characteristics:

  • Discipline and idea
    • Mathematics and the theory of functions
  • The values produced are non-mutable
    • Impossible to change any constituent of a composite value
    • As a remedy, it is possible to make a revised copy of composite value
  • Atemporal
    • Time only plays a minor role compared to the imperative paradigm
  • Applicative
    • All computations are done by applying (calling) functions
  • The natural abstraction is the function
    • Abstracts a single expression to a function which can be evaluated as an expression
  • Functions are first class values
    • Functions are full-fledged data just like numbers, lists, …
  • Fits well with computations driven by needs
    • Opens a new world of possibilities

3. Logic paradigm

Answer a question via search for a solution

Characteristics:

  • Discipline and idea Automatic proofs within artificial intelligence
  • Based on axioms, inference rules, and queries.
  • Program execution becomes a systematic search in a set of facts, making use of a set of inference rules

4. Object-oriented paradigm

Send messages between objects to simulate the temporal evolution of a set of real world phenomena

Characteristics: 

  • Discipline and idea
    • The theory of concepts, and models of human interaction with real world phenomena
  • Data as well as operations are encapsulated in objects
  • Information hiding is used to protect internal properties of an object
  • Objects interact by means of message passing
    • A metaphor for applying an operation on an object
  • Object-oriented languages are divided into
    • class-based
    • prototype-based
Advertisements

2 Comments Add yours

  1. mortoray says:

    I don’t see how these can still be called the “four main paradigms”. All modern programs are at least a mix of 1,2 and 4. The line between them is also incredibly blurred at this point.

  2. ibm2100 says:

    Exactly my viewpoint but the thing is, programming paradigm is different from programs. I’d like to think of programming paradigm as a martial arts technique. If you know multi-programming paradigm, this is akin to a mixed martial arts fighter.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s