0% found this document useful (0 votes)
76 views7 pages

Understanding Programming Paradigms

Uploaded by

tawexab191
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views7 pages

Understanding Programming Paradigms

Uploaded by

tawexab191
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

UNIT-1

What is Programming Paradigm?


A programming paradigm is a style, or “way,” of programming. The term programming
paradigm refers to a style of programming. It does not refer to a specific language, but rather
it refers to the way of writing your program. There are lots of programming languages that
are well-known but all of them need to follow some strategy when they are implemented.
And that strategy is a paradigm.

Some common Paradigms are:


Imperative, Declarative, Structured, Procedural, Functional, Object-Oriented, Event-Driven,
Flow-Driven, Logic, Aspect-Oriented

The two well known programming paradigms are:


1. Procedural oriented programming paradigm
It deals with algorithms, program will be divided into functions and needs less memory.
It follows top-down-approach
Ex: Basic, Pascal, C, C++, Java, ColdFusion - these languages support POP
C is called a structured programming language because to solve a large problem, C
programming language divides the problem into smaller modules called functions or
procedures each of which handles a particular responsibility. The program which solves the
entire problem is a collection of such functions.
Structured Programming is also known as Modular Programming and it is a subset of
Procedural programming.

2. Object oriented programming paradigm


It deals with data rather than algorithms, programs are divided into objects. It is based on the
concept of “objects” that contain data and methods. The primary purpose of object-oriented
programming is to increase the flexibility and maintainability of programs. The focus of
object-oriented programming is to break a complex programming task into objects that
contain fields (to store data) and
methods (to perform operations on fields).
It is the most popular programming paradigm because of its unique advantages like the
modularity of the code and the ability to directly associate real-world business problems in
terms of code.
Ex: Java, Python, Ruby, C++, Smalltalk - these languages support OOP

What is Object-oriented programming (OOP)


Object-oriented programming (OOP) is a computer programming model that organizes
software design around data, or objects, rather than functions and logic. An object can be
defined as a data field that has unique attributes and behavior. OOP 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. Additional benefits of OOP include code reusability, scalability and
efficiency. The main aim of object-oriented programming is to implement real-world entities.

The popular object-oriented languages are Java, C#, PHP, Python, C++, etc.

Structured oriented programming language:


In this type of language, large programs are divided into small programs called functions.
Prime focus is on functions and procedures that operate on data
Data moves freely around the systems from one function to another
Program structure follows “Top Down Approach”
Example: C, Pascal, ALGOL and Modula-2

Advantages:
1. It is user friendly and easy to understand.
2. Similar to English vocabulary of words and symbols.
3. It is easier to learn.
4. They require less time to write.
5. They are easier to maintain.
6. These are mainly problem oriented rather than machine based.

Disadvantages:
1. A high level language has to be translated into the machine language by translator and thus
a price in computer time is paid.
2. The object code generated by a translator might be inefficient compared to an equivalent
assembly language program.
3. Data type is proceeds in many functions in a structured program. When changes occur in
those data types, the corresponding change must be made to every location that acts on
those data types within the program. This is really a very time consuming task if the
program is very large.

Object oriented programming language:


In this type of language, programs are divided into objects
Prime focus is on the data that is being operated and not on the functions or procedures
Data is hidden and cannot be accessed by external functions
Program structure follows “Bottom UP Approach”
Example: C++, JAVA and C# (C sharp)

Advantages of OOP
1. Re-usability
It means reusing some facilities rather than building them

again and again. This is done with the use of a class. We can

use it ‘n’ number of times as per our need.

2. Data Redundancy
This is a condition created at the place of data storage (you

can say Databases)where the same piece of data is held in

two separate places. So the data redundancy is one of the

greatest advantages of OOP. If a user wants a similar

functionality in multiple classes, he/she can go ahead by

writing common class definitions for similar functionalities

and inherit them.

[Link] Maintenance
This feature is more of a necessity for any programming

languages; it helps users from doing re-work in many ways. It

is always easy and time-saving to maintain and modify the

existing codes by incorporating new changes into them.

4. Security
With the use of data hiding and abstraction mechanism, we

are filtering out limited data to exposure, which means we


are maintaining security and providing necessary data to

view.

5. Design Benefits
If you are practicing on OOPs, the design benefit a user will

get is in terms of designing and fixing things easily and

eliminating the risks (if any). Here the Object-Oriented

Programs forces the designers to have a long and extensive

design phase, which results in better designs and fewer

flaws. After a time when the program has reached some

critical limits, it is easier to program all the non-OOP’s one

separately.

6. Better productivity
with the above-mentioned facts of using the application

definitely enhances its users overall productivity. This leads

to more work done, finishing a better program, having more

inbuilt features, and easier reading, writing and maintaining.

An OOP programmer cans stitch new software objects to

make completely new programs. A good number of libraries

with useful functions in abundance make it possible.


7. Easy troubleshooting
When working with object-oriented programming languages, you know exactly
where to look when something goes wrong. “Oh, the car object broke down? The
problem must be in the Car class!” You don’t have to go line-by-line through all your
code.

That’s the beauty of encapsulation. Objects are self-contained, and each bit of
functionality does its own thing while leaving the other bits alone. Also, this
modularity allows an IT team to work on multiple objects simultaneously while
minimizing the chance that one person might duplicate someone else’s functionality.

8. Polymorphism Flexibility
Let’s see a scenario to better explain this behavior.

You behave in a different way if the place or surrounding gets

change. A person will behave like a customer if he is in a

market, the same person will behave like a student if he is in

a school and as a son/daughter if put in a house. Here we can

see that the same person showing different behavior every

time the surroundings are changed. This means

polymorphism is flexible and helps developers in a number of

ways.

 It’s simplicity

 Extensibility
9. Problems solving
Object-oriented programming is ultimately about taking a huge problem and breaking
it down to solvable chunks. For each mini-problem, you write a class that does what
you require. And then — best of all — you can reuse those classes, which makes it
even quicker to solve the next problem.

This isn’t to say that OOP is the only way to write software. But there’s a reason that
languages like C++, C# and Java are the go-to options for serious software
development.

Disadvantages:
1. Steep learning curve: The thought process involved in OO programming may not be
natural for some people, and it will take the time to get used to it.
2. The complexity of creating programs: it is very complex to create programs based on the
interaction of objects. Some of the key programming techniques, such as inheritance and
polymorphism, can be a big challenging to comprehend initially.

Applications of OOP:
User interface design - windows, menu.

Real Time Systems - Air Traffic Control Systems, Networked Multimedia Systems etc.

Simulation and Modelling - Solar activity models, Climate and weather models etc.

Object oriented databases - db4o - db4o was an embeddable open-source object database
for Java and
.NET developers.
zodb -The Zope Object Database is an object-oriented database
for
transparently and persistently storing Python objects.
AI and Expert System - DENDRAL - This was an AI based expert system used essentially
for chemical
analysis.
MYCIN - This was one of the earliest expert systems that was
based on
backward chaining.

Neural Networks and parallel programming - Used in Deep learning concept, Ex: face
detection
Decision support and office automation systems etc. -
DSS - GPS route planning determines the fastest and best route
between two
points by analyzing and comparing multiple possible options.

Office Automation Systems:


Employee analytics - Gusto, Culture Amp, and Luminoso
Meetings - Google meet, Zoom etc.

You might also like