You are on page 1of 9

Government of Kurdistan region

Ministry of Higher Education and Scientific Research


University of Garmian
College of Science
Computer Science
First Stage

PROGRAMMING PARADIGMS

Prepared by:
Shko Maghded Omar Xalid
Supervised by: Salam Ahmed

Friday, May 28, 2021


Table Of Content

INTRODUCTION………………………………………………………
…………………….……….1
IMPERATIVE
PROGRAMMING………………………………………………………
…….….2
Procedural
Programming………………………………………………………
………2
Object Oriented
Programming………………………………………………………3
DECLARATIVE
PROGRAMMING……………………………………………….….
………….4
Functional
Programming…………………………………………………….
…………4
Logic
Programming………………………………………………………
….....………..5
REFERENCES………………………………………..
………………………………………6
INTRODUCTION

Paradigm can also be called as method to solve a problem or to perform a task.


Programming paradigms are an approach to solve problems using a programming
language or also we can say it is a method to solve a problem using tools and
techniques that are available to us following some approach and that approach is
called a paradigm. There are lots for programming languages that are known but
all of them need to follow some strategy when they are implemented and this
methodology/strategy is paradigms. Or in simpler words a programming paradigm
is a style, or “way,” of programming and it does not refer to a specific language,
but rather it refers to the way you program using a specific programming language,
imagine this: you’re going to college like any other day, the road is the language
you program in, the method you choose whether its walking, taking a bus, driving
or even flying to there is the paradigm. Apart from varieties of programming
language there are lots of paradigms to fulfil each and every demand, and in this
report ill discus four of them and Java uses two of them, two imperatives and two
declaratives: Procedural Programming, Object-oriented Programming, Functional
Programming, Logic Programming.

1
IMPERATIVE PROGRAMMING

Imperative programming is a paradigm of computer programming where the


program describes steps that change the state of the computer.

Procedural Programming
Procedural programming (PP) is a programming paradigm, derived from
Imperative Programming, it can be defined like this, based upon the concept of
calling procedure. Procedures, which are also known as routines or functions,
simply consist of a series of computational steps to be carried out. During a
program’s execution, any given procedure might be called at any point, including
by other procedures or itself. Fundamentally, the procedural code is the one that
directly instructs a device on how to finish a task in logical steps. This paradigm
uses a linear top-down approach and treats data and procedures as two different
entities. Based on the concept of a procedure call,
Procedural Programming divides the program into
procedures, simply containing a series of steps to
be carried out. Or Simply put, Procedural
Programming involves writing down a list of
instructions to tell the computer what it should do
step-by-step to finish the task at hand.

Languages that support PP:

 C
Object-Oriented Programming
 C++

 Java

 ColdFusion

 Pascal

a simple Bank Account App in PP


2
Object Oriented programming (OOP) is a programming paradigm, derived from
Imperative Programming, and it can be defined as a programming model which is
based upon the concept of objects. Objects contain data in the form of attributes
and code in the form of methods. In object-oriented programming, computer
programs are designed using the concept of objects that interact with real world. It
focuses on the objects that developers want to manipulate rather than the logic
required to manipulate them. This approach to programming is well-suited for
programs that are large, complex and actively updated or maintained. The
organization of an object-oriented program also makes the method beneficial to
collaborative development, where projects are divided into groups. Additional
benefits of OOP include code reusability, scalability and efficiency. Object
oriented programming languages are various but the most popular ones are class-
based, meaning that objects are instances of classes, which also determine their
types.

Languages that support OOP:

 Python

 Ruby

 Java

 Java Script

 PHP

 C++

 Smalltalk

DECLARATIVE
Object-Oriented Programming PROGRAMMING
Prcedural-Oriented Programing

The program is divided into The program is divided into small


small parts called objects. parts called functions.

follows bottom up approach. follows top down approach.

Adding new data and function Adding new data and function is
is easy. not easy.
It’s based on real world. It’s based on unreal world a simple Bank Account App in OOP

3
Imperative programming is a paradigm of computer programming where programs
describe their desired results without explicitly listing commands or steps that must
be performed.

Functional programming
Functional programming (FP) is a programming paradigm, derived from
Declarative Programming, has its roots in mathematics and it is language
independent. The key principle of this paradigm is the execution of a series of
mathematical functions. You compose your program of short functions. All code is
within a function. All variables are scoped to the function. In the functional
programming paradigm, the functions do not modify any values outside the scope
of that function and the functions themselves are not affected by any values outside
their scope. Or in simpler words Functional programming is the process of building
software by composing pure functions, avoiding shared state, mutable data, and
side-effects. Functional programming is declarative rather than imperative, and
application state flows through pure functions. The opposite with object-oriented
programming, where application state is usually shared and collocated with
methods in objects. Functional code tends to be more concise, more predictable,
and easier to test

Languages that support FP:


 Haskell

 OCaml
Logic Programming
 Scala
Logic Programming (LP) is a programming paradigm, derived from Declarative
 Clojure
Programming which is largely based on formal logic, isn't made up of instructions
- rather
Racketit's made up of facts and clauses. It uses everything it knows and tries to

 JavaScript

A Simple Bank Account App In FP in JS

4
come up with the world where all of those facts and clauses are true. To give you
an idea, Ali is Mohamed’s and Ahmed's father. Laila is Mohamed's and Ahmed's
mother. Now, if someone asks a question like "who is the father of Mohamed and
Ahmed?" or "who is the mother of Mohamed and Ahmed?" we can teach the
computer to answer these questions using logic programming:
Functional Logical Programming
Programming
It is totally based on It is totally based on
functions. formal logic.

Its main aim is to Its main aim is to allow


reduce side effects that
/*We're defining family tree facts*/ machines to reason
are accomplished by because it is very
father (Ali, Mohamed). isolating them from the useful for representing
rest of the software knowledge.
father (Ali, Ahmed). code.
mother (Laila, Mohamed). Testing is much easier Testing is
as compared to logical comparatively more
mother (Laila, Ahmed). programming. difficult

/*We'll ask a questions*/


Languages
? - mother (X,that support//Input
Mohamed). LP: - 1
? - father (X, Ahmed). //Input - 2

X = Laila //Output - 1

X = Ali //Output - 2
REFERENCES

 Prolog

 Absys
1. introduction-of-programming-paradigms
 ALF (algebraic logic functional programming language)

 Alice

 Ciao

5
2. paradigms
3. freecodecamp - what-exactly-is-a-programming-paradigm
4. definition of object-oriented-programming-OOP
5. procedural-programming
6. Logic programming
7. programming-paradigms
8. what-is-functional-programming

The sources were much more than that but that’s all
what i listed here
Did And
you know
if youthat
readweitcurrently have
all and you 700 programming
gained languages?
some info then,
245 of themThank
are notably
You used worldwide

You might also like