SlideShare a Scribd company logo
21CSC203P
Advanced Programming Practice
UNIT 1 PPT
(2021 regulation)
1
What is Programming Languages
Elements of Programming languages
Programming Language Theory
Bohm- Jacopini structured program theorem
Multiple Programming Paradigm
Programming Paradigm hierarchy
2
 Programming languages are formal languages designed to communicate instructions to a
computer system or a computing device. They serve as a means for humans to write programs
and develop software applications that can be executed by computers. Each programming
language has its own syntax and set of rules that define how programs should be written.
 Programming languages can be classified into different types, including:
1. Low-Level Languages: These languages are close to machine code and provide little or no
abstraction from the computer's hardware. Examples include assembly languages and machine
languages.
2. High-Level Languages: These languages are designed to be closer to human language and provide
a higher level of abstraction. They offer built-in functions, libraries, and data structures that
simplify programming tasks. Examples include Python, Java, C++, C#, Ruby, and JavaScript.
3. Scripting Languages: These languages are often interpreted rather than compiled and are used to
automate tasks or perform specific functions within a larger program. Examples include Python,
Perl, Ruby, and JavaScript.
3
What is Programming Languages ?
What is Programming Languages
4. Object-Oriented Languages: These languages emphasize the concept of objects, which
encapsulate both data and the functions (methods) that operate on that data. Examples
include Java, C++, C#, and Python.
5. Functional Languages: These languages treat computation as the evaluation of
mathematical functions and avoid changing state or mutable data. Examples include
Haskell, Lisp, and Erlang.
6. Domain-Specific Languages (DSLs): These languages are designed for specific domains or
problem areas, with specialized syntax and features tailored to those domains. Examples
include SQL for database management, HTML/CSS for web development, and MATLAB for
numerical computing.
Programming languages have different strengths and weaknesses, and developers choose a
language based on factors such as project requirements, performance needs, development
speed, community support, and personal preference. Learning multiple languages can give
programmers flexibility and allow them to solve different types of problems more effectively.
4
Elements of Programming languages
 Here are the fundamental elements commonly found in programming languages:
1. Variables: Variables are used to store and manipulate data during program
execution. They have a name, a type, and a value associated with them.
Programming languages may have different rules for variable declaration,
initialization, and scoping.
2. Data Types: Programming languages support various data types, such as integers,
floating-point numbers, characters, strings, booleans, arrays, and more. Data types
define the kind of values that can be stored and manipulated in variables.
3. Operators: Operators perform operations on data, such as arithmetic operations
(addition, subtraction, etc.), comparison operations (equal to, greater than, etc.),
logical operations (AND, OR), and assignment operations (assigning values to
variables).
4. Control Structures: Control structures allow programmers to control the flow of
execution in a program. Common control structures include conditionals (if-else
statements, switch statements), loops (for loops, while loops), and branching (goto
statements).
5. Functions and Procedures: Functions and procedures are reusable blocks of code
that perform a specific task. They take input parameters, perform computations,
and optionally return values. Functions and procedures facilitate modular and
organized programming.
5
5. Expressions: Expressions are combinations of variables, constants, operators, and
function calls that evaluate to a value. They are used to perform calculations, make
decisions, and manipulate data.
6. Statements: Statements are individual instructions or commands in a programming
language. They perform specific actions or control the program's behavior. Examples
include variable assignments, function calls, and control flow statements.
7. Syntax: Syntax defines the rules and structure of a programming language. It specifies
how programs should be written using a specific set of symbols, keywords, and rules.
Syntax determines the correctness and readability of the code.
8. Comments: Comments are used to add explanatory or descriptive text within the code.
They are ignored by the compiler or interpreter and serve as documentation for
programmers or readers of the code.
9. Libraries and Modules: Libraries or modules are prewritten collections of code that
provide additional functionality to a programming language. They contain reusable
functions, classes, or other components that can be imported into programs to extend
their capabilities.
 These are some of the core elements of programming languages. Different programming
languages may have additional features, syntax rules, or concepts specific to their
design and purpose.
6
Programming Language Theory
 Programming Language Theory is a field of computer science that studies the design, analysis,
and implementation of programming languages. It focuses on understanding the principles,
concepts, and foundations that underlie programming languages and their use.
 Programming Language Theory covers a broad range of topics, including:
 Syntax and Semantics: This area deals with the formal representation and interpretation of
programming language constructs. It involves defining the syntax (grammar) of a language
and specifying the meaning (semantics) of its constructs.
 Type Systems: Type systems define and enforce the rules for assigning types to expressions
and variables in a programming language. They ensure type safety and help catch errors at
compile-time.
 Programming Language Design and Implementation: This aspect involves the process of
creating new programming languages or extending existing ones. It explores language
features, constructs, and paradigms, and how they can be efficiently implemented.
 Programming Language Semantics: Semantics concerns the meaning and behavior of
programs. It involves defining mathematical models or operational semantics to formally
describe program execution and behavior.
7
 Programming Language Analysis: This area focuses on static and dynamic analysis of
programs, including type checking, program verification, optimization techniques, and
program understanding.
 Formal Methods: Formal methods involve using mathematical techniques to analyze and
prove properties of programs and programming languages. It aims to ensure correctness,
safety, and reliability of software systems.
 Language Paradigms: Programming Language Theory explores different programming
paradigms, such as procedural, object-oriented, functional, logic, and concurrent
programming. It investigates the principles, strengths, and limitations of each paradigm.
 Language Implementation Techniques: This aspect covers compiler design,
interpretation, code generation, runtime systems, and virtual machines. It investigates
efficient strategies for executing programs written in various programming languages.
 Language Expressiveness: Language expressiveness refers to the power and flexibility of a
programming language in expressing different computations, algorithms, and abstractions. It
explores the trade-offs between expressiveness and other factors such as performance and
readability.
 Programming Language Theory provides the foundation for understanding and reasoning
about programming languages. It helps in the development of new languages, designing better
programming constructs, improving software quality, and building efficient and reliable
software systems
8
BOhm-Jacopini theorem/ Structured Program Theorem
The Böhm-Jacopini theorem, formulated independently by Corrado
Böhm and Giuseppe Jacopini, is a fundamental result in programming
language theory.
It states that any computation can be performed using only three basic
control structures: sequence, selection (if-then-else), and iteration (while
or for loops). This means that any program, regardless of its complexity,
can be expressed using these three control structures alone.
The theorem is significant because it establishes that more complex
control structures, such as goto statements or multiple exit points, are
not necessary to express any algorithm.
By limiting the control structures to sequence, selection, and
iteration, the theorem promotes structured programming, which
emphasizes readable and modular code.
9
10
To understand the Böhm-Jacopini theorem, let's look at the three
basic control structures it allows:
i) Sequence: This control structure allows a series of statements to be executed
in a specific order, one after another.
Executing one subprogram, and then another subprogram (sequence)
For example:
Statement 1;
Statement 2;
Statement 3;
To review, sequence performs some operations S1;
S2 meaning perform S1; then perform S2.
11
Java Program for sequence
import java .io.*;
class sample
{
public static void main(String args[])
{
System.out.println(“Hai”);
}
}
Save : sample.java
Compile: javac sample.java
Run: java sample
12
ii) Selection (if-then-else): This control structure enables a program to
make decisions based on certain conditions. It executes one set of statements if a
condition is true and another set of statements if the condition is false.
Executing one of two subprograms according to the value of a boolean expression
(selection).
Selection says, if Q is true, then perform S1, else perform S2.
For example: (if, if-else, if-elseif-else, nested-if)
if (condition) {
Statement 1;
} else {
Statement 2;
}
13
If else
Syntax:
if test expression:
statement(s)
If else
Syntax:
if test expression:
Body of if
else:
Body of else
If elif else
Syntax:
if test expression:
Body of if
elif test expression:
Body of elif
else:
Body of else
Arun, Asst Prof, Dept of SWE, SRMIST
Selection Statement
Python program for Selection:
num = float(input("Enter a number: "))
if num > 0:
print("Positive number")
print("This is always printed")
Example:
num = float(input("Enter a number: "))
if num >= 0:
print("Positive or Zero")
else:
print("Negative number")
Example:
num = float(input("Enter a number: "))
if num > 0:
print("Positive number")
elif num == 0:
print("Zero")
else:
print("Negative number")
15
Java Program for selection
import java .io.*;
class sample
{
public static void main(String args[])
{
int a=5, b=3, c>2;
if(a>b)&&(a>c)
System.out.println(“a is greater than b and c”);
elseif(b>a)&&(b>c)
System.out.println(“b is greater than a and c”);
else
System.out.println(“c is greater than a and b”);
}
}
Save : sample.java
Compile: javac sample.java
Run: java sample
16
iii) Iteration (while or for loops): This control structure allows a set of
statements to be repeated until a certain condition is satisfied. It executes the
statements repeatedly as long as the condition holds true.
Example (for, while, do-while)
Loop says while Q is true, do S.
For example:
i) while (condition) {
Statement; }
program until a Boolean expression is true (iteration)
ii) do{
Statement;
}while (condition);
iii) for(initialization; condition; increment/decrement)
{
statement;}
17
Java Program for iteration
import java .io.*;
class sample
{
public static void main(String args[])
{
int sum=0,i;
for(i=0;i<10;i++)
{
sum=sum+i;
}
System.out.println(sum);
}
}
Save : sample.java
Compile: javac sample.java
Run: java sample
18
Python Program for Iteration
while loop
Syntax:
while expression:
statement(s)
Example:
count = 0
while (count < 9):
print 'The count is:', count
count = count + 1
print "Good bye!”
For Loop
Syntax:
for iterating_var in sequence:
statements(s)
Example:
for letter in 'Python': # First Example
print 'Current Letter :', letter
fruits = ['banana', 'apple', 'mango']
for index in range(len(fruits)):
print 'Current fruit :', fruits[index]
print "Good bye!“
19
 The Böhm-Jacopini theorem states that any program can be structured
using these three control structures alone. This means that complex
programs with loops, conditionals, and multiple branches can be rewritten
using only sequence, selection, and iteration constructs.
 The theorem assures that these basic structures are sufficient to express
any algorithm or computation, promoting clarity and simplicity in program
design.
 While the Böhm-Jacopini theorem advocates for the use of structured
programming principles, it is important to note that modern programming
languages often provide additional control structures and abstractions to
enhance code readability and maintainability.
 These higher-level constructs build upon the foundations established by
the theorem but allow for more expressive and efficient programming
 The Böhm-Jacopini theorem, also called structured program theorem,
stated that working out a function is possible by combining subprograms
in only three manners:
20
Multiple programming paradigms
 Multiple programming paradigms, also known as multi-paradigm programming, refers to the ability of a
programming language to support and integrate multiple programming styles or paradigms within a single
language. A programming paradigm is a way of thinking and structuring programs based on certain
principles and concepts.
 A multi-paradigm programming language is a computer language that provides several abstraction
mechanisms. Different programming problems require different approaches, so a good programming
language should support multiple paradigms .
 Traditionally, programming languages have been associated with a specific paradigm, such as procedural,
object-oriented, or functional. However, with the advancement of programming language design, many
modern languages have incorporated elements and features from multiple paradigms, providing developers
with more flexibility and expressive power.
 Procedural Programming: This paradigm focuses on the step-by-step execution of a sequence of instructions
or procedures. It emphasizes the use of procedures or functions to organize and structure code.
21
 Some common programming paradigms include
1. Structural Programming Paradigm
2. Procedural Programming Paradigm
3. Object-Oriented Programming Paradigm
4. Concurrent Programming Paradigm
5. Declarative Programming Paradigm
6. Graphical User Interface Based Programming Paradigm
7. Functional Programming Paradigm
8. Logic Programming Paradigm
9. Parallel Programming Paradigm
10. Network Programming Paradigm
11. Automata Based programming Paradigm
12. Symbolic Programming Paradigm
13. Event Programming Paradigm
14. Imperative Programming Paradigm
22
 Object-Oriented Programming (OOP): OOP is based on the concept of objects
that encapsulate data and behavior. It promotes modularity, reusability, and data
abstraction. Languages like C++, Java, and Python support OOP.
 Functional Programming: This paradigm treats computation as the evaluation of
mathematical functions. It emphasizes immutability, pure functions, and higher-
order functions. Languages like Haskell, Lisp, and Scala support functional
programming.
 Declarative Programming: Declarative programming focuses on describing the
desired result rather than specifying the detailed steps to achieve it. Examples
include SQL for database queries and HTML/CSS for web development.
 Logic Programming: Logic programming involves defining relationships and
rules and letting the program reason about queries and logical inferences. Prolog
is a popular logic programming language.
 Concurrent Programming: Concurrent programming deals with handling multiple
tasks or processes that execute concurrently or in parallel. It addresses
synchronization, communication, and coordination among concurrent processes.
Languages like Go, Erlang, and Java (with concurrency libraries) provide support
for concurrent programming.
23
 Structured Programming: Structured programming builds upon imperative
programming and emphasizes the use of structured control flow constructs like
loops and conditionals. It aims to improve code readability and maintainability by
using procedures, functions, and modules for organizing and structuring code.
Languages like C, Pascal, and Python support structured programming.
 By supporting multiple paradigms, programming languages can address different
problem domains and allow developers to choose the most appropriate style for a
given task. This flexibility enables the combination of different programming
techniques within a single program, leading to more expressive and maintainable
code. It also promotes code reuse and interoperability between different paradigms,
as developers can leverage the strengths of each paradigm to solve specific
challenges
24
Programming Paradigm hierarchy
 A hierarchy in programming is an organizational structure in which items are
ranked according to levels of importance. The concept of a programming paradigm
hierarchy refers to the organization and relationship between different programming
paradigms based on their characteristics and capabilities. It provides a way to
understand how various paradigms relate to each other and how they build upon or
differ from one another in terms of abstraction, data handling, control flow, and
programming concepts
 While there is no universally accepted
hierarchy, here is a general representation
of the programming paradigm hierarchy:
25
Ad

More Related Content

Similar to Advanced Programming Paradigm Introduction.pdf (20)

9. Software Implementation
9. Software Implementation9. Software Implementation
9. Software Implementation
ghayour abbas
 
Programming
ProgrammingProgramming
Programming
vanesa4ab
 
SYSTEM DEVELOPMENT
SYSTEM DEVELOPMENTSYSTEM DEVELOPMENT
SYSTEM DEVELOPMENT
shahzadebaujiti
 
Define Computer language, Translator, Standard input out C
Define Computer language, Translator, Standard input out CDefine Computer language, Translator, Standard input out C
Define Computer language, Translator, Standard input out C
Dr Shailendra Bhalawe
 
PCCF-UNIT 2-1 new.docx
PCCF-UNIT 2-1 new.docxPCCF-UNIT 2-1 new.docx
PCCF-UNIT 2-1 new.docx
prakashvs7
 
Structured programming & Programming methodologies.pptx
Structured programming & Programming methodologies.pptxStructured programming & Programming methodologies.pptx
Structured programming & Programming methodologies.pptx
Ritu Sachdeva
 
Computer Programming
Computer Programming Computer Programming
Computer Programming
Newreborn Incarnation
 
Computer
ComputerComputer
Computer
Newreborn Incarnation
 
Prgramming paradigms
Prgramming paradigmsPrgramming paradigms
Prgramming paradigms
Anirudh Chauhan
 
Unit 1
Unit 1Unit 1
Unit 1
ankita1317
 
JAVA
JAVAJAVA
JAVA
sonali_iul
 
Introduction to high level Computer programming
Introduction  to high level Computer programmingIntroduction  to high level Computer programming
Introduction to high level Computer programming
bilalchuddher
 
Ndu06 typesof language
Ndu06 typesof languageNdu06 typesof language
Ndu06 typesof language
nicky_walters
 
Compiler Design Using Context-Free Grammar
Compiler Design Using Context-Free GrammarCompiler Design Using Context-Free Grammar
Compiler Design Using Context-Free Grammar
IRJET Journal
 
Cobbbbbbbnnnnnnnnnnnnnnnnncepts of PL.pptx
Cobbbbbbbnnnnnnnnnnnnnnnnncepts of PL.pptxCobbbbbbbnnnnnnnnnnnnnnnnncepts of PL.pptx
Cobbbbbbbnnnnnnnnnnnnnnnnncepts of PL.pptx
mehrankhan7842312
 
La 5 Programming1
La 5   Programming1La 5   Programming1
La 5 Programming1
Cma Mohd
 
Computer-System-Software_hhhGroup-3.pptx
Computer-System-Software_hhhGroup-3.pptxComputer-System-Software_hhhGroup-3.pptx
Computer-System-Software_hhhGroup-3.pptx
Firstjww Lastjsjs
 
Basic programming and data structure
Basic programming and data structureBasic programming and data structure
Basic programming and data structure
Viswanath Polaki
 
Training 8051Report
Training 8051ReportTraining 8051Report
Training 8051Report
Kuldeep Kaushik
 
Introduction-to-Programming-Languages.pptx
Introduction-to-Programming-Languages.pptxIntroduction-to-Programming-Languages.pptx
Introduction-to-Programming-Languages.pptx
ranjan317165
 
9. Software Implementation
9. Software Implementation9. Software Implementation
9. Software Implementation
ghayour abbas
 
Define Computer language, Translator, Standard input out C
Define Computer language, Translator, Standard input out CDefine Computer language, Translator, Standard input out C
Define Computer language, Translator, Standard input out C
Dr Shailendra Bhalawe
 
PCCF-UNIT 2-1 new.docx
PCCF-UNIT 2-1 new.docxPCCF-UNIT 2-1 new.docx
PCCF-UNIT 2-1 new.docx
prakashvs7
 
Structured programming & Programming methodologies.pptx
Structured programming & Programming methodologies.pptxStructured programming & Programming methodologies.pptx
Structured programming & Programming methodologies.pptx
Ritu Sachdeva
 
Introduction to high level Computer programming
Introduction  to high level Computer programmingIntroduction  to high level Computer programming
Introduction to high level Computer programming
bilalchuddher
 
Ndu06 typesof language
Ndu06 typesof languageNdu06 typesof language
Ndu06 typesof language
nicky_walters
 
Compiler Design Using Context-Free Grammar
Compiler Design Using Context-Free GrammarCompiler Design Using Context-Free Grammar
Compiler Design Using Context-Free Grammar
IRJET Journal
 
Cobbbbbbbnnnnnnnnnnnnnnnnncepts of PL.pptx
Cobbbbbbbnnnnnnnnnnnnnnnnncepts of PL.pptxCobbbbbbbnnnnnnnnnnnnnnnnncepts of PL.pptx
Cobbbbbbbnnnnnnnnnnnnnnnnncepts of PL.pptx
mehrankhan7842312
 
La 5 Programming1
La 5   Programming1La 5   Programming1
La 5 Programming1
Cma Mohd
 
Computer-System-Software_hhhGroup-3.pptx
Computer-System-Software_hhhGroup-3.pptxComputer-System-Software_hhhGroup-3.pptx
Computer-System-Software_hhhGroup-3.pptx
Firstjww Lastjsjs
 
Basic programming and data structure
Basic programming and data structureBasic programming and data structure
Basic programming and data structure
Viswanath Polaki
 
Introduction-to-Programming-Languages.pptx
Introduction-to-Programming-Languages.pptxIntroduction-to-Programming-Languages.pptx
Introduction-to-Programming-Languages.pptx
ranjan317165
 

Recently uploaded (20)

Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdfKit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Wonjun Hwang
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
ACE Aarhus - Team'25 wrap-up presentation
ACE Aarhus - Team'25 wrap-up presentationACE Aarhus - Team'25 wrap-up presentation
ACE Aarhus - Team'25 wrap-up presentation
DanielEriksen5
 
IT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information TechnologyIT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information Technology
SHEHABALYAMANI
 
May Patch Tuesday
May Patch TuesdayMay Patch Tuesday
May Patch Tuesday
Ivanti
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
João Esperancinha
 
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
ICT Frame Magazine Pvt. Ltd.
 
Artificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptxArtificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptx
03ANMOLCHAURASIYA
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Why Slack Should Be Your Next Business Tool? (Tips to Make Most out of Slack)
Why Slack Should Be Your Next Business Tool? (Tips to Make Most out of Slack)Why Slack Should Be Your Next Business Tool? (Tips to Make Most out of Slack)
Why Slack Should Be Your Next Business Tool? (Tips to Make Most out of Slack)
Cyntexa
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Top 5 Qualities to Look for in Salesforce Partners in 2025
Top 5 Qualities to Look for in Salesforce Partners in 2025Top 5 Qualities to Look for in Salesforce Partners in 2025
Top 5 Qualities to Look for in Salesforce Partners in 2025
Damco Salesforce Services
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
Top-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptxTop-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptx
BR Softech
 
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdfICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
Eryk Budi Pratama
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdfKit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Wonjun Hwang
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
ACE Aarhus - Team'25 wrap-up presentation
ACE Aarhus - Team'25 wrap-up presentationACE Aarhus - Team'25 wrap-up presentation
ACE Aarhus - Team'25 wrap-up presentation
DanielEriksen5
 
IT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information TechnologyIT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information Technology
SHEHABALYAMANI
 
May Patch Tuesday
May Patch TuesdayMay Patch Tuesday
May Patch Tuesday
Ivanti
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
João Esperancinha
 
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
MULTI-STAKEHOLDER CONSULTATION PROGRAM On Implementation of DNF 2.0 and Way F...
ICT Frame Magazine Pvt. Ltd.
 
Artificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptxArtificial_Intelligence_in_Everyday_Life.pptx
Artificial_Intelligence_in_Everyday_Life.pptx
03ANMOLCHAURASIYA
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Why Slack Should Be Your Next Business Tool? (Tips to Make Most out of Slack)
Why Slack Should Be Your Next Business Tool? (Tips to Make Most out of Slack)Why Slack Should Be Your Next Business Tool? (Tips to Make Most out of Slack)
Why Slack Should Be Your Next Business Tool? (Tips to Make Most out of Slack)
Cyntexa
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Top 5 Qualities to Look for in Salesforce Partners in 2025
Top 5 Qualities to Look for in Salesforce Partners in 2025Top 5 Qualities to Look for in Salesforce Partners in 2025
Top 5 Qualities to Look for in Salesforce Partners in 2025
Damco Salesforce Services
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
Top-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptxTop-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptx
BR Softech
 
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdfICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
ICDCC 2025: Securing Agentic AI - Eryk Budi Pratama.pdf
Eryk Budi Pratama
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
Ad

Advanced Programming Paradigm Introduction.pdf

  • 2. What is Programming Languages Elements of Programming languages Programming Language Theory Bohm- Jacopini structured program theorem Multiple Programming Paradigm Programming Paradigm hierarchy 2
  • 3.  Programming languages are formal languages designed to communicate instructions to a computer system or a computing device. They serve as a means for humans to write programs and develop software applications that can be executed by computers. Each programming language has its own syntax and set of rules that define how programs should be written.  Programming languages can be classified into different types, including: 1. Low-Level Languages: These languages are close to machine code and provide little or no abstraction from the computer's hardware. Examples include assembly languages and machine languages. 2. High-Level Languages: These languages are designed to be closer to human language and provide a higher level of abstraction. They offer built-in functions, libraries, and data structures that simplify programming tasks. Examples include Python, Java, C++, C#, Ruby, and JavaScript. 3. Scripting Languages: These languages are often interpreted rather than compiled and are used to automate tasks or perform specific functions within a larger program. Examples include Python, Perl, Ruby, and JavaScript. 3 What is Programming Languages ?
  • 4. What is Programming Languages 4. Object-Oriented Languages: These languages emphasize the concept of objects, which encapsulate both data and the functions (methods) that operate on that data. Examples include Java, C++, C#, and Python. 5. Functional Languages: These languages treat computation as the evaluation of mathematical functions and avoid changing state or mutable data. Examples include Haskell, Lisp, and Erlang. 6. Domain-Specific Languages (DSLs): These languages are designed for specific domains or problem areas, with specialized syntax and features tailored to those domains. Examples include SQL for database management, HTML/CSS for web development, and MATLAB for numerical computing. Programming languages have different strengths and weaknesses, and developers choose a language based on factors such as project requirements, performance needs, development speed, community support, and personal preference. Learning multiple languages can give programmers flexibility and allow them to solve different types of problems more effectively. 4
  • 5. Elements of Programming languages  Here are the fundamental elements commonly found in programming languages: 1. Variables: Variables are used to store and manipulate data during program execution. They have a name, a type, and a value associated with them. Programming languages may have different rules for variable declaration, initialization, and scoping. 2. Data Types: Programming languages support various data types, such as integers, floating-point numbers, characters, strings, booleans, arrays, and more. Data types define the kind of values that can be stored and manipulated in variables. 3. Operators: Operators perform operations on data, such as arithmetic operations (addition, subtraction, etc.), comparison operations (equal to, greater than, etc.), logical operations (AND, OR), and assignment operations (assigning values to variables). 4. Control Structures: Control structures allow programmers to control the flow of execution in a program. Common control structures include conditionals (if-else statements, switch statements), loops (for loops, while loops), and branching (goto statements). 5. Functions and Procedures: Functions and procedures are reusable blocks of code that perform a specific task. They take input parameters, perform computations, and optionally return values. Functions and procedures facilitate modular and organized programming. 5
  • 6. 5. Expressions: Expressions are combinations of variables, constants, operators, and function calls that evaluate to a value. They are used to perform calculations, make decisions, and manipulate data. 6. Statements: Statements are individual instructions or commands in a programming language. They perform specific actions or control the program's behavior. Examples include variable assignments, function calls, and control flow statements. 7. Syntax: Syntax defines the rules and structure of a programming language. It specifies how programs should be written using a specific set of symbols, keywords, and rules. Syntax determines the correctness and readability of the code. 8. Comments: Comments are used to add explanatory or descriptive text within the code. They are ignored by the compiler or interpreter and serve as documentation for programmers or readers of the code. 9. Libraries and Modules: Libraries or modules are prewritten collections of code that provide additional functionality to a programming language. They contain reusable functions, classes, or other components that can be imported into programs to extend their capabilities.  These are some of the core elements of programming languages. Different programming languages may have additional features, syntax rules, or concepts specific to their design and purpose. 6
  • 7. Programming Language Theory  Programming Language Theory is a field of computer science that studies the design, analysis, and implementation of programming languages. It focuses on understanding the principles, concepts, and foundations that underlie programming languages and their use.  Programming Language Theory covers a broad range of topics, including:  Syntax and Semantics: This area deals with the formal representation and interpretation of programming language constructs. It involves defining the syntax (grammar) of a language and specifying the meaning (semantics) of its constructs.  Type Systems: Type systems define and enforce the rules for assigning types to expressions and variables in a programming language. They ensure type safety and help catch errors at compile-time.  Programming Language Design and Implementation: This aspect involves the process of creating new programming languages or extending existing ones. It explores language features, constructs, and paradigms, and how they can be efficiently implemented.  Programming Language Semantics: Semantics concerns the meaning and behavior of programs. It involves defining mathematical models or operational semantics to formally describe program execution and behavior. 7
  • 8.  Programming Language Analysis: This area focuses on static and dynamic analysis of programs, including type checking, program verification, optimization techniques, and program understanding.  Formal Methods: Formal methods involve using mathematical techniques to analyze and prove properties of programs and programming languages. It aims to ensure correctness, safety, and reliability of software systems.  Language Paradigms: Programming Language Theory explores different programming paradigms, such as procedural, object-oriented, functional, logic, and concurrent programming. It investigates the principles, strengths, and limitations of each paradigm.  Language Implementation Techniques: This aspect covers compiler design, interpretation, code generation, runtime systems, and virtual machines. It investigates efficient strategies for executing programs written in various programming languages.  Language Expressiveness: Language expressiveness refers to the power and flexibility of a programming language in expressing different computations, algorithms, and abstractions. It explores the trade-offs between expressiveness and other factors such as performance and readability.  Programming Language Theory provides the foundation for understanding and reasoning about programming languages. It helps in the development of new languages, designing better programming constructs, improving software quality, and building efficient and reliable software systems 8
  • 9. BOhm-Jacopini theorem/ Structured Program Theorem The Böhm-Jacopini theorem, formulated independently by Corrado Böhm and Giuseppe Jacopini, is a fundamental result in programming language theory. It states that any computation can be performed using only three basic control structures: sequence, selection (if-then-else), and iteration (while or for loops). This means that any program, regardless of its complexity, can be expressed using these three control structures alone. The theorem is significant because it establishes that more complex control structures, such as goto statements or multiple exit points, are not necessary to express any algorithm. By limiting the control structures to sequence, selection, and iteration, the theorem promotes structured programming, which emphasizes readable and modular code. 9
  • 10. 10
  • 11. To understand the Böhm-Jacopini theorem, let's look at the three basic control structures it allows: i) Sequence: This control structure allows a series of statements to be executed in a specific order, one after another. Executing one subprogram, and then another subprogram (sequence) For example: Statement 1; Statement 2; Statement 3; To review, sequence performs some operations S1; S2 meaning perform S1; then perform S2. 11
  • 12. Java Program for sequence import java .io.*; class sample { public static void main(String args[]) { System.out.println(“Hai”); } } Save : sample.java Compile: javac sample.java Run: java sample 12
  • 13. ii) Selection (if-then-else): This control structure enables a program to make decisions based on certain conditions. It executes one set of statements if a condition is true and another set of statements if the condition is false. Executing one of two subprograms according to the value of a boolean expression (selection). Selection says, if Q is true, then perform S1, else perform S2. For example: (if, if-else, if-elseif-else, nested-if) if (condition) { Statement 1; } else { Statement 2; } 13
  • 14. If else Syntax: if test expression: statement(s) If else Syntax: if test expression: Body of if else: Body of else If elif else Syntax: if test expression: Body of if elif test expression: Body of elif else: Body of else Arun, Asst Prof, Dept of SWE, SRMIST Selection Statement
  • 15. Python program for Selection: num = float(input("Enter a number: ")) if num > 0: print("Positive number") print("This is always printed") Example: num = float(input("Enter a number: ")) if num >= 0: print("Positive or Zero") else: print("Negative number") Example: num = float(input("Enter a number: ")) if num > 0: print("Positive number") elif num == 0: print("Zero") else: print("Negative number") 15
  • 16. Java Program for selection import java .io.*; class sample { public static void main(String args[]) { int a=5, b=3, c>2; if(a>b)&&(a>c) System.out.println(“a is greater than b and c”); elseif(b>a)&&(b>c) System.out.println(“b is greater than a and c”); else System.out.println(“c is greater than a and b”); } } Save : sample.java Compile: javac sample.java Run: java sample 16
  • 17. iii) Iteration (while or for loops): This control structure allows a set of statements to be repeated until a certain condition is satisfied. It executes the statements repeatedly as long as the condition holds true. Example (for, while, do-while) Loop says while Q is true, do S. For example: i) while (condition) { Statement; } program until a Boolean expression is true (iteration) ii) do{ Statement; }while (condition); iii) for(initialization; condition; increment/decrement) { statement;} 17
  • 18. Java Program for iteration import java .io.*; class sample { public static void main(String args[]) { int sum=0,i; for(i=0;i<10;i++) { sum=sum+i; } System.out.println(sum); } } Save : sample.java Compile: javac sample.java Run: java sample 18
  • 19. Python Program for Iteration while loop Syntax: while expression: statement(s) Example: count = 0 while (count < 9): print 'The count is:', count count = count + 1 print "Good bye!” For Loop Syntax: for iterating_var in sequence: statements(s) Example: for letter in 'Python': # First Example print 'Current Letter :', letter fruits = ['banana', 'apple', 'mango'] for index in range(len(fruits)): print 'Current fruit :', fruits[index] print "Good bye!“ 19
  • 20.  The Böhm-Jacopini theorem states that any program can be structured using these three control structures alone. This means that complex programs with loops, conditionals, and multiple branches can be rewritten using only sequence, selection, and iteration constructs.  The theorem assures that these basic structures are sufficient to express any algorithm or computation, promoting clarity and simplicity in program design.  While the Böhm-Jacopini theorem advocates for the use of structured programming principles, it is important to note that modern programming languages often provide additional control structures and abstractions to enhance code readability and maintainability.  These higher-level constructs build upon the foundations established by the theorem but allow for more expressive and efficient programming  The Böhm-Jacopini theorem, also called structured program theorem, stated that working out a function is possible by combining subprograms in only three manners: 20
  • 21. Multiple programming paradigms  Multiple programming paradigms, also known as multi-paradigm programming, refers to the ability of a programming language to support and integrate multiple programming styles or paradigms within a single language. A programming paradigm is a way of thinking and structuring programs based on certain principles and concepts.  A multi-paradigm programming language is a computer language that provides several abstraction mechanisms. Different programming problems require different approaches, so a good programming language should support multiple paradigms .  Traditionally, programming languages have been associated with a specific paradigm, such as procedural, object-oriented, or functional. However, with the advancement of programming language design, many modern languages have incorporated elements and features from multiple paradigms, providing developers with more flexibility and expressive power.  Procedural Programming: This paradigm focuses on the step-by-step execution of a sequence of instructions or procedures. It emphasizes the use of procedures or functions to organize and structure code. 21
  • 22.  Some common programming paradigms include 1. Structural Programming Paradigm 2. Procedural Programming Paradigm 3. Object-Oriented Programming Paradigm 4. Concurrent Programming Paradigm 5. Declarative Programming Paradigm 6. Graphical User Interface Based Programming Paradigm 7. Functional Programming Paradigm 8. Logic Programming Paradigm 9. Parallel Programming Paradigm 10. Network Programming Paradigm 11. Automata Based programming Paradigm 12. Symbolic Programming Paradigm 13. Event Programming Paradigm 14. Imperative Programming Paradigm 22
  • 23.  Object-Oriented Programming (OOP): OOP is based on the concept of objects that encapsulate data and behavior. It promotes modularity, reusability, and data abstraction. Languages like C++, Java, and Python support OOP.  Functional Programming: This paradigm treats computation as the evaluation of mathematical functions. It emphasizes immutability, pure functions, and higher- order functions. Languages like Haskell, Lisp, and Scala support functional programming.  Declarative Programming: Declarative programming focuses on describing the desired result rather than specifying the detailed steps to achieve it. Examples include SQL for database queries and HTML/CSS for web development.  Logic Programming: Logic programming involves defining relationships and rules and letting the program reason about queries and logical inferences. Prolog is a popular logic programming language.  Concurrent Programming: Concurrent programming deals with handling multiple tasks or processes that execute concurrently or in parallel. It addresses synchronization, communication, and coordination among concurrent processes. Languages like Go, Erlang, and Java (with concurrency libraries) provide support for concurrent programming. 23
  • 24.  Structured Programming: Structured programming builds upon imperative programming and emphasizes the use of structured control flow constructs like loops and conditionals. It aims to improve code readability and maintainability by using procedures, functions, and modules for organizing and structuring code. Languages like C, Pascal, and Python support structured programming.  By supporting multiple paradigms, programming languages can address different problem domains and allow developers to choose the most appropriate style for a given task. This flexibility enables the combination of different programming techniques within a single program, leading to more expressive and maintainable code. It also promotes code reuse and interoperability between different paradigms, as developers can leverage the strengths of each paradigm to solve specific challenges 24
  • 25. Programming Paradigm hierarchy  A hierarchy in programming is an organizational structure in which items are ranked according to levels of importance. The concept of a programming paradigm hierarchy refers to the organization and relationship between different programming paradigms based on their characteristics and capabilities. It provides a way to understand how various paradigms relate to each other and how they build upon or differ from one another in terms of abstraction, data handling, control flow, and programming concepts  While there is no universally accepted hierarchy, here is a general representation of the programming paradigm hierarchy: 25
  翻译: