SlideShare a Scribd company logo
1 of 33
MAJOR PROGRAMMING
PARADIGMS
MUHAMMED ASIM YILDIZ
Inside
 What is Programming Paradigms?
 Imperative vs Declarative Programming Paradigms
 4 Major Programming Paradigms
 Procedural Programming Paradigm
 Logical Programming Paradigm
 Functional Programming Paradigm
 Object Oriented Programming Paradigm
Programming Paradigm
 Is an approach to programming a computer;
 Based on mathematical theory or
 A coherent set of principles
Imperative – Declarative Programming
Paradigms
 Question :
 I’m right next to Eagle Statue. How do I get to Digiturk from here?
 How can we define it with Imperative PP?
 How can we define it with Declarative PP?
Imperative Way
 Head east on Mumcu Bakkal Sokağı toward Şht. Asım Cd.
 Turn left onto Şht. Asım Cd.
 Continue onto Masuklar Ykş. (110m)
 Continue onto Yıldız Cd. (270m)
 Digiturk is on the right
Declarative Way
 Digiturk’s address is Cihannüma, Yıldız Cd., 34353 Beşiktaş/İstanbul
Imperative programming is like how you do something,
while declarative programming is more like what you do.
Another Example
 You go to a restaurant and approach the front desk
 If you say :
 I see that table located under the TV is empty
 I would like to sit there
 IMPERATIVE (define how to get a table)
 Or if you say :
 Table for one, please
 DECLARATIVE (what you want)
Many (if not all) declarative approaches
have some sort of underlying imperative abstraction.
Imperative-Declarative Relation
 The declarative response for restaurant assumes that the front-desk guy knows..
 Knowing the Digiturk address assumes you have a some sort of GPS that knows..
 ‘THE IMPERATIVE STEPS’
Examples of PP with
Programming Languages
 SQL :
 HTML :
<article>
<header>
<h1>Declarative Programming</h1>
<p>Sprinkle Declarative in your verbiage to sound smart</p>
</header>
</article>
SELECT * FROM Users WHERE Country=’Mexico’;
Examples of PP with
Programming Languages
 Javascript (write a function called double which takes an array, and return a new array where
the values doubled) :
function double (arr) {
let results = []
for (let i = 0; i < arr.length; i++){
results.push(arr[i] * 2)
}
return results
}
function double (arr) {
return arr.map((item) => item * 2)
}
Programming Languages by Paradigms
 Imperative: C, C++, Java
 Declarative: SQL, HTML
 (Can Be) Mix: JavaScript, C#, Python
4 Major Programming Paradigms
 Imperative
 Procedural
 Object-Oriented
 Declarative
 Logical
 Functional
IMPERATIVE PROGRAMMING PARADIGMS
Procedural Programming Paradigm
 The entire program is a single algorithm consists of independent modules
 The complete functionality written linearly (step-by-step)
Procedural PP Example
Procedural PP Advantages
 Efficient (modules are easier to write)
 Close to the machine
 Best for expressing algorithms
Procedural PP Disadvantages
 The semantics of the program can be complex
 Hard to understand and hard to prove (lots of modules)
 Side effects make debugging harder
 Order is crucial (step-by-step)
Object Oriented Programming Paradigm
 Real-world objects are each viewed as seperate entities
 Each object has it’s own state which is modified only by built in methods
 Objects operated independently (communication is done by message passing)
OOP PP Example
OOP PP Advantages
 Inheritance (reusable code and code extensibility)
 Changing code without the need to change existing code (subclass)
 Encapsulation and information hiding
 Prevents data from being accessed by the code outside
 Define data as private and open them to outside by public methods
 Parallel code development with big teams
 More human-friendly and readable code
OOP PP Disadvantages
 First time coding can be more extensive (code duplication)
 Can create a massive amount of unnecessary code
 Can be slow because of the overhead (negligible)
DECLARATIVE PROGRAMMING PARADIGMS
Logical Programming Paradigm
 Execution of a logic program is a theorem proving process (Datalog, Prolog)
 Program statements express facts, rules and predicates
 It consists from a system of formal logic
Logical PP Example
 Given information about fatherhood and motherhood, determine grand parent relationship :
 Given the information called facts;
 John is father of Lily – father(john, lily)
 Kathy is mother of Lily – mother(kathy, lily)
 Lily is mother of Bill – mother(lily, bill)
 Ken is father of Karen – father(ken, karen)
 Who are grand parents of Bill?
 grandparent(X,Z) :- parent(X,Y), parent(Y,Z)
 parent(X,Y) :-father(X,Y)
 parent(X,Y) :-mother(X,Y).
Logical PP Advantages
 The system solves the problem
 Programming steps are kept to a minimum
 Proving the validity of the program is simple
Logical PP Disadvantages
 Not efficient as other programming paradigms
 Takes too much effort to create a program
 Not widely used (medical diagnosis, robot control etc.)
Functional Programming Paradigm
 Views all subprograms as functions (in mathematical sense)
 Functions take in arguments and return a single solution
 Solution returned is based entirely on the input
 The time which a function is called has no revelance
Functional PP Example
Functional PP Advantages
 High level of abstraction
 Functions suppress many of the programming details
 Removes the possibility of making too many errors (simple)
 Good candidates for programming to parallel computers
Functional PP Disadvantages
 Problems involving many variables or
 Problems with a lot of sequential code runs;
 Sometimes easier to implement with Object oriented programming
THANK YOU

More Related Content

What's hot

Introduction to object oriented language
Introduction to object oriented languageIntroduction to object oriented language
Introduction to object oriented languagefarhan amjad
 
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTSE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTnikshaikh786
 
diffrence between procedure oriented programming & object oriented programmin...
diffrence between procedure oriented programming & object oriented programmin...diffrence between procedure oriented programming & object oriented programmin...
diffrence between procedure oriented programming & object oriented programmin...nihar joshi
 
Basics of coding
Basics of codingBasics of coding
Basics of codingSanaaSharda
 
Deep learning for NLP and Transformer
 Deep learning for NLP  and Transformer Deep learning for NLP  and Transformer
Deep learning for NLP and TransformerArvind Devaraj
 
NLP using transformers
NLP using transformers NLP using transformers
NLP using transformers Arvind Devaraj
 
1 Intro Object Oriented Programming
1  Intro Object Oriented Programming1  Intro Object Oriented Programming
1 Intro Object Oriented ProgrammingDocent Education
 
Doppl development iteration #6
Doppl development   iteration #6Doppl development   iteration #6
Doppl development iteration #6Diego Perini
 
Mi0041 java and web design
Mi0041  java and web designMi0041  java and web design
Mi0041 java and web designsmumbahelp
 
Mi0041 java and web design
Mi0041  java and web designMi0041  java and web design
Mi0041 java and web designsmumbahelp
 
Mi0041 java and web design
Mi0041  java and web designMi0041  java and web design
Mi0041 java and web designsmumbahelp
 
Concepts of OOPs
Concepts of OOPsConcepts of OOPs
Concepts of OOPsEssay Corp
 
Transformer Introduction (Seminar Material)
Transformer Introduction (Seminar Material)Transformer Introduction (Seminar Material)
Transformer Introduction (Seminar Material)Yuta Niki
 
Introduction to database-ER Model
Introduction to database-ER ModelIntroduction to database-ER Model
Introduction to database-ER ModelAjit Nayak
 
BINF 3121 Data Analysis Report How-To
BINF 3121 Data Analysis Report How-ToBINF 3121 Data Analysis Report How-To
BINF 3121 Data Analysis Report How-ToAnn Loraine
 
Integration of speech recognition with computer assisted translation
Integration of speech recognition with computer assisted translationIntegration of speech recognition with computer assisted translation
Integration of speech recognition with computer assisted translationChamani Shiranthika
 

What's hot (20)

Introduction to object oriented language
Introduction to object oriented languageIntroduction to object oriented language
Introduction to object oriented language
 
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTSE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
 
Introduction to programing languages part 2
Introduction to programing languages   part 2Introduction to programing languages   part 2
Introduction to programing languages part 2
 
Introduction to programing languages part 3
Introduction to programing languages part 3Introduction to programing languages part 3
Introduction to programing languages part 3
 
diffrence between procedure oriented programming & object oriented programmin...
diffrence between procedure oriented programming & object oriented programmin...diffrence between procedure oriented programming & object oriented programmin...
diffrence between procedure oriented programming & object oriented programmin...
 
Basics of coding
Basics of codingBasics of coding
Basics of coding
 
Deep learning for NLP and Transformer
 Deep learning for NLP  and Transformer Deep learning for NLP  and Transformer
Deep learning for NLP and Transformer
 
NLP using transformers
NLP using transformers NLP using transformers
NLP using transformers
 
1 Intro Object Oriented Programming
1  Intro Object Oriented Programming1  Intro Object Oriented Programming
1 Intro Object Oriented Programming
 
Doppl development iteration #6
Doppl development   iteration #6Doppl development   iteration #6
Doppl development iteration #6
 
Compare between pop and oop
Compare between pop and oopCompare between pop and oop
Compare between pop and oop
 
Mi0041 java and web design
Mi0041  java and web designMi0041  java and web design
Mi0041 java and web design
 
Mi0041 java and web design
Mi0041  java and web designMi0041  java and web design
Mi0041 java and web design
 
Mi0041 java and web design
Mi0041  java and web designMi0041  java and web design
Mi0041 java and web design
 
Introduction to Transformer Model
Introduction to Transformer ModelIntroduction to Transformer Model
Introduction to Transformer Model
 
Concepts of OOPs
Concepts of OOPsConcepts of OOPs
Concepts of OOPs
 
Transformer Introduction (Seminar Material)
Transformer Introduction (Seminar Material)Transformer Introduction (Seminar Material)
Transformer Introduction (Seminar Material)
 
Introduction to database-ER Model
Introduction to database-ER ModelIntroduction to database-ER Model
Introduction to database-ER Model
 
BINF 3121 Data Analysis Report How-To
BINF 3121 Data Analysis Report How-ToBINF 3121 Data Analysis Report How-To
BINF 3121 Data Analysis Report How-To
 
Integration of speech recognition with computer assisted translation
Integration of speech recognition with computer assisted translationIntegration of speech recognition with computer assisted translation
Integration of speech recognition with computer assisted translation
 

Similar to Major Programming Paradigms

final report.doc
final report.docfinal report.doc
final report.docbutest
 
Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)Ahmed Gad
 
program development and paradigms
program development and paradigmsprogram development and paradigms
program development and paradigmskasenerd
 
PCCF UNIT 2 CLASS.pptx
PCCF UNIT 2 CLASS.pptxPCCF UNIT 2 CLASS.pptx
PCCF UNIT 2 CLASS.pptxvishnupriyapm4
 
Programming Paradigms Seminar 1
Programming Paradigms Seminar 1Programming Paradigms Seminar 1
Programming Paradigms Seminar 1neoxiuting
 
OOP Unit 1 - Foundation of Object- Oriented Programming
OOP Unit 1 - Foundation of Object- Oriented ProgrammingOOP Unit 1 - Foundation of Object- Oriented Programming
OOP Unit 1 - Foundation of Object- Oriented Programmingdkpawar
 
Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...
Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...
Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...MLconf
 
Intro. to prog. c++
Intro. to prog. c++Intro. to prog. c++
Intro. to prog. c++KurdGul
 
Need of OOPs and Programming,pop vs oop
Need of OOPs and Programming,pop vs oopNeed of OOPs and Programming,pop vs oop
Need of OOPs and Programming,pop vs oopJanani Selvaraj
 
Designing function families and bundles with java's behaviors parameterisatio...
Designing function families and bundles with java's behaviors parameterisatio...Designing function families and bundles with java's behaviors parameterisatio...
Designing function families and bundles with java's behaviors parameterisatio...Alain Lompo
 
Program logic and design
Program logic and designProgram logic and design
Program logic and designChaffey College
 
Boost Your Base Bootcamp - [Online & Offline] In Bangla
Boost Your Base Bootcamp - [Online & Offline] In BanglaBoost Your Base Bootcamp - [Online & Offline] In Bangla
Boost Your Base Bootcamp - [Online & Offline] In BanglaStack Learner
 

Similar to Major Programming Paradigms (20)

final report.doc
final report.docfinal report.doc
final report.doc
 
Logic programming in python
Logic programming in pythonLogic programming in python
Logic programming in python
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)Introduction to Prolog (PROramming in LOGic)
Introduction to Prolog (PROramming in LOGic)
 
program development and paradigms
program development and paradigmsprogram development and paradigms
program development and paradigms
 
UNIT1-JAVA.pptx
UNIT1-JAVA.pptxUNIT1-JAVA.pptx
UNIT1-JAVA.pptx
 
PCCF UNIT 2 CLASS.pptx
PCCF UNIT 2 CLASS.pptxPCCF UNIT 2 CLASS.pptx
PCCF UNIT 2 CLASS.pptx
 
Programming Paradigms Seminar 1
Programming Paradigms Seminar 1Programming Paradigms Seminar 1
Programming Paradigms Seminar 1
 
OOP Unit 1 - Foundation of Object- Oriented Programming
OOP Unit 1 - Foundation of Object- Oriented ProgrammingOOP Unit 1 - Foundation of Object- Oriented Programming
OOP Unit 1 - Foundation of Object- Oriented Programming
 
Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...
Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...
Avi Pfeffer, Principal Scientist, Charles River Analytics at MLconf SEA - 5/2...
 
3.5
3.53.5
3.5
 
Intro. to prog. c++
Intro. to prog. c++Intro. to prog. c++
Intro. to prog. c++
 
Need of OOPs and Programming,pop vs oop
Need of OOPs and Programming,pop vs oopNeed of OOPs and Programming,pop vs oop
Need of OOPs and Programming,pop vs oop
 
Designing function families and bundles with java's behaviors parameterisatio...
Designing function families and bundles with java's behaviors parameterisatio...Designing function families and bundles with java's behaviors parameterisatio...
Designing function families and bundles with java's behaviors parameterisatio...
 
Procedural programming
Procedural programmingProcedural programming
Procedural programming
 
Beekman5 std ppt_13
Beekman5 std ppt_13Beekman5 std ppt_13
Beekman5 std ppt_13
 
Program logic and design
Program logic and designProgram logic and design
Program logic and design
 
Python training
Python trainingPython training
Python training
 
OOPJ.pptx
OOPJ.pptxOOPJ.pptx
OOPJ.pptx
 
Boost Your Base Bootcamp - [Online & Offline] In Bangla
Boost Your Base Bootcamp - [Online & Offline] In BanglaBoost Your Base Bootcamp - [Online & Offline] In Bangla
Boost Your Base Bootcamp - [Online & Offline] In Bangla
 

More from ASIMYILDIZ

Ott Streaming Protocols and DRM
Ott Streaming Protocols and DRMOtt Streaming Protocols and DRM
Ott Streaming Protocols and DRMASIMYILDIZ
 
Javascript on Server-Side
Javascript on Server-SideJavascript on Server-Side
Javascript on Server-SideASIMYILDIZ
 
Software Design Principles (SOLID)
Software Design Principles (SOLID)Software Design Principles (SOLID)
Software Design Principles (SOLID)ASIMYILDIZ
 

More from ASIMYILDIZ (6)

Ott Streaming Protocols and DRM
Ott Streaming Protocols and DRMOtt Streaming Protocols and DRM
Ott Streaming Protocols and DRM
 
Javascript on Server-Side
Javascript on Server-SideJavascript on Server-Side
Javascript on Server-Side
 
Software Design Principles (SOLID)
Software Design Principles (SOLID)Software Design Principles (SOLID)
Software Design Principles (SOLID)
 
Redux Thunk
Redux ThunkRedux Thunk
Redux Thunk
 
React Native
React NativeReact Native
React Native
 
Temiz Kod
Temiz KodTemiz Kod
Temiz Kod
 

Recently uploaded

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 

Recently uploaded (20)

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 

Major Programming Paradigms

  • 2. Inside  What is Programming Paradigms?  Imperative vs Declarative Programming Paradigms  4 Major Programming Paradigms  Procedural Programming Paradigm  Logical Programming Paradigm  Functional Programming Paradigm  Object Oriented Programming Paradigm
  • 3. Programming Paradigm  Is an approach to programming a computer;  Based on mathematical theory or  A coherent set of principles
  • 4. Imperative – Declarative Programming Paradigms  Question :  I’m right next to Eagle Statue. How do I get to Digiturk from here?  How can we define it with Imperative PP?  How can we define it with Declarative PP?
  • 5. Imperative Way  Head east on Mumcu Bakkal Sokağı toward Şht. Asım Cd.  Turn left onto Şht. Asım Cd.  Continue onto Masuklar Ykş. (110m)  Continue onto Yıldız Cd. (270m)  Digiturk is on the right
  • 6. Declarative Way  Digiturk’s address is Cihannüma, Yıldız Cd., 34353 Beşiktaş/İstanbul
  • 7. Imperative programming is like how you do something, while declarative programming is more like what you do.
  • 8. Another Example  You go to a restaurant and approach the front desk  If you say :  I see that table located under the TV is empty  I would like to sit there  IMPERATIVE (define how to get a table)  Or if you say :  Table for one, please  DECLARATIVE (what you want)
  • 9. Many (if not all) declarative approaches have some sort of underlying imperative abstraction.
  • 10. Imperative-Declarative Relation  The declarative response for restaurant assumes that the front-desk guy knows..  Knowing the Digiturk address assumes you have a some sort of GPS that knows..  ‘THE IMPERATIVE STEPS’
  • 11. Examples of PP with Programming Languages  SQL :  HTML : <article> <header> <h1>Declarative Programming</h1> <p>Sprinkle Declarative in your verbiage to sound smart</p> </header> </article> SELECT * FROM Users WHERE Country=’Mexico’;
  • 12. Examples of PP with Programming Languages  Javascript (write a function called double which takes an array, and return a new array where the values doubled) : function double (arr) { let results = [] for (let i = 0; i < arr.length; i++){ results.push(arr[i] * 2) } return results } function double (arr) { return arr.map((item) => item * 2) }
  • 13. Programming Languages by Paradigms  Imperative: C, C++, Java  Declarative: SQL, HTML  (Can Be) Mix: JavaScript, C#, Python
  • 14. 4 Major Programming Paradigms  Imperative  Procedural  Object-Oriented  Declarative  Logical  Functional
  • 16. Procedural Programming Paradigm  The entire program is a single algorithm consists of independent modules  The complete functionality written linearly (step-by-step)
  • 18. Procedural PP Advantages  Efficient (modules are easier to write)  Close to the machine  Best for expressing algorithms
  • 19. Procedural PP Disadvantages  The semantics of the program can be complex  Hard to understand and hard to prove (lots of modules)  Side effects make debugging harder  Order is crucial (step-by-step)
  • 20. Object Oriented Programming Paradigm  Real-world objects are each viewed as seperate entities  Each object has it’s own state which is modified only by built in methods  Objects operated independently (communication is done by message passing)
  • 22. OOP PP Advantages  Inheritance (reusable code and code extensibility)  Changing code without the need to change existing code (subclass)  Encapsulation and information hiding  Prevents data from being accessed by the code outside  Define data as private and open them to outside by public methods  Parallel code development with big teams  More human-friendly and readable code
  • 23. OOP PP Disadvantages  First time coding can be more extensive (code duplication)  Can create a massive amount of unnecessary code  Can be slow because of the overhead (negligible)
  • 25. Logical Programming Paradigm  Execution of a logic program is a theorem proving process (Datalog, Prolog)  Program statements express facts, rules and predicates  It consists from a system of formal logic
  • 26. Logical PP Example  Given information about fatherhood and motherhood, determine grand parent relationship :  Given the information called facts;  John is father of Lily – father(john, lily)  Kathy is mother of Lily – mother(kathy, lily)  Lily is mother of Bill – mother(lily, bill)  Ken is father of Karen – father(ken, karen)  Who are grand parents of Bill?  grandparent(X,Z) :- parent(X,Y), parent(Y,Z)  parent(X,Y) :-father(X,Y)  parent(X,Y) :-mother(X,Y).
  • 27. Logical PP Advantages  The system solves the problem  Programming steps are kept to a minimum  Proving the validity of the program is simple
  • 28. Logical PP Disadvantages  Not efficient as other programming paradigms  Takes too much effort to create a program  Not widely used (medical diagnosis, robot control etc.)
  • 29. Functional Programming Paradigm  Views all subprograms as functions (in mathematical sense)  Functions take in arguments and return a single solution  Solution returned is based entirely on the input  The time which a function is called has no revelance
  • 31. Functional PP Advantages  High level of abstraction  Functions suppress many of the programming details  Removes the possibility of making too many errors (simple)  Good candidates for programming to parallel computers
  • 32. Functional PP Disadvantages  Problems involving many variables or  Problems with a lot of sequential code runs;  Sometimes easier to implement with Object oriented programming