The World of Programming Paradigms
First of
all, let’s know about what a computer program is. You all know a computer
program is a set of instructions that are arranged in a structured way. It
performs specific tasks when it is executed by the computer. According to history, with the Von Neumann computer architecture, the stored program concept
was introduced. Actually, it is the inception of modern computers. In the early
stages, programmers used machine language to write programs (binary) that can
be directly understood by the computer. However, with the expansion of user
needs it is very hard to write with machine language. To solve that problem
machine language emerged. But after years of time, it became very difficult to
debug programs in assembly language. With time programmers tried to find better solutions for these problems.
What is a paradigm?
Let’s
clarify this using an example. A long time ago, scientists thought that there are
only atomic particles and they can’t divide furthermore. But after years and many
experiments, they discovered that there are also subatomic particles existing
in nature. When looking at this example we can identify that atomic theory
is one paradigm and subatomic theory is another paradigm. In this case, atomic
theory shifted to subatomic theory. Now you can understand paradigm is a set of interrelated
theories, perceptions, concepts, and practices within the community about a
subject at a particular time, it is a set of generally accepted scientific
achievements and models that defines how to look at problems and how to solve
them. With the time, community starts to criticize it and emerge a new
paradigm. This process is known as a paradigm shift. This shifting takes a long
time to change with the understanding drawbacks of exiting system.
1. 1. Programming paradigms
A programming paradigm is a way to classify programming languages according to their features
and ways of performing tasks. Programming languages can be classified into
multiple paradigms. However, mainly two different paradigms are evolved with time.
1.1
Imperative Programming paradigm-
·
Oldest
and most traditional paradigm in the world.
·
Developed
with the emergence of the machine and assembly language.
·
Main
feature is a sequence of explicit commands.
·
User
must write the command correctly and feed it into the computer.
1.1.1
Procedural
Programming
· Basic concept of the procedural call.
· Contain a
series of computational steps to be carried out.
· Examples are FORTRAN,
ALGOL, COBOL, PL/I, and BASIC.
1.1.2
Object-Oriented Programming
· Based
on the concept of ‘objects’ which can contain data and code.
· Computer
programs are designed by making them out of objects that interact with one
another.
· Some Object-Oriented languages are Java, C++, C#, Python, R, PHP,
VB.NET, JavaScript, Ruby, Perl, SIMSCRIPT, Object Pascal, Smalltalk, MATLAB,
etc.
1.2
Declarative programming paradigm.
·
Focus
on the end result.
·
Can
be divided into two types.
1.2.1 Functional Programming Paradigm
· Programs
are constructed by applying and composing functions.
· Function
definitions are trees of expressions that map values to other values rather
than a sequence.
· Functions
are treated as first-class citizens.
1.2.2 Functional logic programming language
· Designed
to handle symbolic computation and list processing applications.
· Includes
both functional and logical concepts.
· Popular functional programming languages are Lisp, Python, Erlang, Haskell, Clojure, etc.
2. 2. Database management language paradigm
This
is a type of declarative
programming language for creating and controlling database systems. Mainly
there are two kinds of paradigms.
2.1 Structured Query Language (SQL)
The relational database includes tables, relations between tables, and schemas. A few examples of the SQL languages are MySQL, MS SQL Server, Oracle.
2.2 NoSQL
NoSQL has a dynamic schema for unstructured
data, and data is stored in many ways. NoSQL can create documents without
having to first define their structure and each document has its own unique
structure. The syntax can vary from database to database.
3. 3. Object-Oriented Programming Paradigm
OOP
is derived from the imperative paradigm and OOP concepts. OOP is not a language. A
feature of objects is that an object's own procedures can access and often
modify its data fields. OOP is writing programs considering objects and
their relationships. Template for and object in programming is called class.
4. 4. Parallel Programming
Running Programs simultaneously with a multi-processor has less processing time than running programs with a single processor. Using parallel programming in C is
important to increase the performance of the software.
Kalana Minipuraarachchi
BSE(UG) OUSL