0% found this document useful (0 votes)
10 views4 pages

Class Material 1 24-09-24

A programming paradigm is a high-level method for structuring and conceptualizing computer programs, which can be classified into various types like imperative and declarative. Imperative programming focuses on how to achieve goals through state changes, while declarative programming emphasizes what needs to be done without detailing control flow. Common paradigms include procedural, object-oriented, functional, and logic programming, each with distinct advantages and examples.

Uploaded by

Utsav Dk
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)
10 views4 pages

Class Material 1 24-09-24

A programming paradigm is a high-level method for structuring and conceptualizing computer programs, which can be classified into various types like imperative and declarative. Imperative programming focuses on how to achieve goals through state changes, while declarative programming emphasizes what needs to be done without detailing control flow. Common paradigms include procedural, object-oriented, functional, and logic programming, each with distinct advantages and examples.

Uploaded by

Utsav Dk
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
You are on page 1/ 4

Programming Paradigms

A programming paradigm is a relatively high-level way to structure and conceptualize the


implementation of a computer program.

A programming language can be classified as supporting one or more paradigms.

Paradigm can also be termed as method to solve some problem or do some task.

Programming paradigm is an approach to solve problem using some 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.

Paradigms are separated along and described by different dimensions of programming.

Some paradigms are about implications of the execution model,

Other paradigms are about the way code is organized, such as grouping into units that include both
state and behavior.

Yet others are about syntax and grammar.

Some common programming paradigms include (shown in hierarchical relationship)

 Imperative – code directly controls execution flow and state change


o procedural – organized as procedures that call each other
o object-oriented – organized as objects that contain both data structure and associated behavior
 Declarative – code declares properties of the desired result, but not how to compute it
o functional – a desired result is declared as the value of a series of function evaluations
o logic – a desired result is declared as the answer to a question about a system of facts and rules
o reactive – a desired result is declared with data streams and the propagation of change
1. Imperative programming paradigm:
It works by changing the program state through assignment statements. It performs step by
step task by changing state. The main focus is on how to achieve the goal.

Advantage:

1. Very simple to implement


2. It contains loops, variables etc.

Disadvantage:

1. Complex problem cannot be solved


2. Less efficient and less productive
3. Parallel programming is not possible

Examples of Imperative programming paradigm: C, Fortan …..

Imperative programming is divided into three broad categories:


 Procedural
 OOP
 Parallel processing

Procedural:
Procedural is similar to the imperative approach.
Examples of Procedural programming paradigm:
C : developed by Dennis Ritchie and Ken Thompson
C++ : developed by Bjarne Stroustrup
Java : developed by James Gosling at Sun Microsystems
OOP:
The program is written as a collection of classes and object which are meant for
communication. More emphasis is on data rather procedure.

Advantages:
 Data security
 Inheritance
 Code reusability
 Flexible and abstraction is also present
Examples of Object Oriented programming paradigm: Java, C++, Python

Parallel processing:

Parallel processing is the processing of program instructions by dividing them among multiple
processors. This approach seems to be like divide and conquer.

2. Declarative programming paradigm:


Declarative programming is a style of building programs that expresses logic of computation
without talking about its control flow. The focus is on what needs to be done rather how it
should be done
Logic programming paradigms:
It can be termed as abstract model of computation. It would solve logical problems like puzzles,
series etc. In logical programming the main emphasize is on knowledge base and the problem.
The execution of the program is very much like proof of mathematical statement, e.g., Prolog

Functional programming paradigms:


Functional programming is style of programming in which the basic method of computation is
the application of functions to arguments, e.g., Haskwell
Example:
Summing integers 1 to 10 in JAVA:
total = 0;
for (i = 1; i  10; ++i)
total = total+i;
Here the computation method is variable assignment

Summing integers 1 to 10 in Haskwell


sum [1..10]
Here the computation method is functional application.

Database/Data driven programming approach:


This programming methodology is based on data and its movement. Program statements are
defined by data rather than hard-coding a series of steps. A database program is the heart of a
business information system and provides file creation, data entry, update, query and reporting
functions, e.g. SQL

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy