SlideShare una empresa de Scribd logo
1 de 56
Descargar para leer sin conexión
PROGRAMMING LANGUAGE
PARADIGMS
WHAT IS PARADIGM?
It’s a way (or) style of thinking to solve a
problem!
WHAT IS PROGRAMMING
LANGUAGE PARADIGM?
A programming language paradigm is a way in which
computer language looks at the problem to be solved
TYPES OF PROGRAMMING LANGUAGE PARADIGM:
IMPERATIVE PARADIGM DECLARATIVE PARADIGM
PROCEDURAL
OBJECT ORIENTED PROGRAMMING
PARALLEL PROCESSING
LOGIC
FUNCTIONAL
DATABASE
WHY DO WE NEED SO MANY PARADIGMS?
• Each problem requires a different way of
approach.
• To facilitate the different styles of approach
we need different paradigms.
• For ex: some problem requires mathematical
model and a clear flow to denote how to find
a solution;
• While, some problems just require a solution
Which to learn first? Language or
paradigm
• Before learning any subject we must learn it’s
paradigm first.
• This allows us to code the language in a way
the compiler assumes flow of control and give
an optimized coding.
IMPERATIVE PARADIGM
It is the form and style of programming in which we care
about “how” we get to an answer, step by step process.
Instructing the computer to perform in certain way to
solve a task.
Declarative Programming Paradigm:
• This is the form or style of programming where
we are most concerned with “what” we want as
the answer, or what would be returned.
• Declarative code focuses on building logic of
software without actually,describing its flow.
• Eg: <Img src=”./image.jpg”/>
• HTML,XML,CSS,SQL,Prolong,Haskell,F# and Lisp
belongs under declarative paradigm.
• Programs written this way often compile to
binary executables that run more efficiently.
Eg: CPU instructions are imperative
statements.
• To make programs simpler to understand,
statements have been grouped into sections
using blocks.
Eg: c,c++,c#,java
PROCEDURAL PROGRAMMING PARADIGM:
• writing down instructions step-by-step to get final
result
• procedural code directly instructs a device on how
to finish a task in logical steps
• linear top-down approach
• treats data and procedures as two different
entities
• divides the program into procedures, which are
also known as routines or functions, simply
containing a series of steps to be carried out
PROCEDURAL PROGRAMMING PARADIGM:
• third-generation languages
• contrasted with is event-driven programming
• procedures are called/executed only in
response to events
• events are unpredictable
• the procedures that handle them cannot be
executed linearly as is the case with
procedural programming
Key Features of Procedural Programming
• Predefined functions
• Local Variable
• Global Variable
• Modularity
• Parameter Passing
Procedural Programming Languages
• COmmon Business Oriented Language
(COBOL)
• FORmula TRANslation (FORTRAN)
• ALGOrithmic Language (ALGOL)
• Programming Language One (PL/I)
• Beginners All purpose Symbolic Instruction
Code (BASIC)
• C
Parallel computing
• is a type of computation in which many
calculations or the execution of processes are
carried out simultaneously
• it is the use of multiple processing elements
simultaneously for solving any problem.
Problems are broken down into instructions
and are solved concurrently as each resource
which has been applied to work is working at
the same time
PARALLEL COMPUTING
• people standing in a queue waiting for movie
ticket and there is only cashier. Cashier is
giving ticket one by one to the persons.
Complexity of this situation increases when
there are 2 queues and only one cashier
• the complexity will decrease when there are 2
queues and 2 cashier giving tickets to 2
persons simultaneously. This is an example of
Parallel Computing.
Why parallel computing?
• real world runs in dynamic nature
• real data needs more dynamic simulation and
modeling, and for achieving the same, parallel
computing is the key
• provides concurrency and saves time and money
• complex, large datasets, and their management can be
organized
• ensures the effective utilization of the resources
• hardware is guaranteed to be used effectively
• it is impractical to implement real-time systems using
serial computing
Limitations of parallel Computing
• communication and synchronization between
multiple sub-tasks and processes which is difficult
to achieve
• algorithms must be managed so they can be
handled in the parallel mechanism.
• the algorithms or program must have low
coupling and high cohesion. But it’s difficult to
create such programs.
• skilled and expert programmers can code a
parallelism based program well.
APPLICATIONS
• Databases and Data mining.
• Real time simulation of systems.
• Science and Engineering.
• Advanced graphics, augmented reality and
virtual reality
OBJECT-ORIENTED PROGRAMMING
Based on objects data
methods
Aims to incorporate advantages of modularity
and reusability
Objects instances of classes
can interact with each other.
Ex: C++,Java,Python,Ruby, etc.
THE IMPORTANT FEATURES OF OBJECT–
ORIENTED PROGRAMMING ARE
• Bottom–up approach in program design
• Programs organized around objects, grouped
in classes
• Focus on data with methods to operate upon
object’s data
• Interaction between objects through
functions
• Reusability of design through creation of new
classes by adding features to existing classes
THE BASIC CONCEPTS INVOLVED IN
OBJECT ORIENTED APPROACH INCLUDE
• Class
• Object
• Attributes
• Methods
• Inheritance
• Abstraction
• Encapsulation and Information hiding
• Polymorphism
CLASS
• Abstract data type
• Blueprint describing the nature of something
• Data structure may contain different fields
• Object defined to contain procedures
that act on it.
Attributes operations
/fields /methods
OBJECT
• An induvidual of a class created @ run-time
from a class
• Object state.->{values} of attributes of
a particular object
• Behaviour defined in class
• Initialized by implicitly calling its constructor
• One of the member function.
ATTRIBUTES
• Data members/ member variables
• Data encapsulated within a class or object
• Attributes object’s variables
Initialized using constructor
On further excecution,
will represent the state of object
INHERITANCE
• Compartmentalizes, hence code is reusable
• By creating collections of attributes & behaviours,
based on prev defined classes
• New classes, (a.k.a. subclasses) inherits attributes
& behaviours of Super class(es).
• This inheritance relationship gives rise to an
Hierarchy
• Single class can inherit from 2 classes that have
members bearing the same names_ but different
meaning.
ABSTRACTION
• Simplifying a complex reality by Modelling
classes appropriate to the problem
• OOP provides abstraction through
composition &inheritance
• CLASS CAR
{engine,gearbox,steering}
• To drive we don’t need to know how diff
components work internally, we just need to
interface with (by sending and receiving
messages from) them.
ENCAPSULATION AND INFORMATION HIDING
• Bundling of data members & member fn()
• Choosing whether to either expose or hide
some of the members of a class
• Achieved by specifying which classes may use
the members
• Prevents Unauthorized objects to change the
state of an object
POLYMORPHISM
• Poly-many morphs-forms
• Ability of a message to be displayed in more than
one form.
Father
• A man husband
Employee
• Same person posses different behaviour in
different situations
• One interface- multiple implentations
TYPES OF DECLARATIVE PARADIGM
• LOGIC PARADIGM
• FUNCTIONAL PARADIGM
• DATABASE PARADIGM
LOGIC PARADIGM
• Logic paradigm program statements express facts
and rules about problems within a system of
formal logic.
• A logical program is divided into three sections:
• (i) A series of definitions that define the problem
domain
• (ii) Reports of relevant facts.
• (iii) Declaration of aims in the form of a request
Any deducible answer to a query is returned. The
definitions and declarations are built entirely from
relations.
ADVANTAGES OF LOGICAL
PROGRAMMING
• The advantages of logic oriented
programming are :
• (i) The system solves the problem thus the
programming steps themselves are kept to a
minimum.
• (ii) Demonstrating the rationality of a given
program is quite easy.
LANGUAGES USING LOGIC PARADIGM
• Datalog
• ASP
• prolog
FUNCTIONAL PARADIGM
• The key principal of this paradigms is the
execution of series of mathematical functions
• Function can be replaced with their values
without changing the meaning of the program.
• The Functional Programming paradigm uses
mathematical functions. With this, operations are
performed based solely based on the inputs into
the program, and does not rely on temporary (or
hidden) variables in with which to store results
between inputs.
ADVANTAGE OF FUNTIONAL PARADIGM
• code more readable and easily understandable
• testing and debugging is easier
• Used to implement concurrency because pure
function does not change variables
• Values are stored and used only when it is needed
• Functional Languages provide a protected
environment.
• Due to functional programming depends only on the
arguments input to the function; it does not suffer
from side effects.
DISADVANTAGE OF FUNCTIONAL PARADIGM
• Recursion can lead to decrease in performance
• Functional programming can be less efficient than
other languages.
• They tend to require a large amount of time and
memory.
• Purely Functional Languages are not really used in
commercial software development because
WRITING pure functions are difficuilt to combine.
PROGRAMMING LANGUAGE USING
FUNCTIONAL PARADIGM
• Haskell
• JavaScript
• Scala
• Lisp
• ML
• Clojure
• Common Lisp
DATABASE/DATA DRIVEN
PROGRAMMING APPROACH
• Database programming methodology is based
on data and its movement.
• Program statements are defined by data
• A database program is the heart of a business
information system and provides file creation,
data entry, update, query and reporting
functions.
DATABASE OR DATADRIVEN
PROGRAMMING LANGUAGE
• AWK
• Oz
• Perl – data-driven programming as in AWK
and sed is one paradigm supported by Perl
• sed
• Lua
• Clojure
ADVANTAGES OF DATABASE
PARADIGM
• Functionality simply requires that it knows
the abstract data type of the variables it is
working with.
• Functions and interfaces can be used on all
objects with the same data field
• Can grouped data of any objects or entities
without consequences
DISADVANTAGE OF DATABASE
PARADIGM
• When dealing with the abstract data types can
lead to bad object oriented programming
• Any attempt to change the structure of the
object would immediately break the functions
MINOR PARIDIGMS
• 2 Types
• Aspect Oriented Programming
• Event-Driven Programming
ASPECT ORIENTED PROGRAMMING
• AOP complementary to OOP
• AOP: Modularizes code into several processes;
OOP: Modularises code to objects
• Provides programmers the separation of
concern, facilitates several cross cutting
concerns
• Adds additional behaviour to the code
without modifying the code
NEED FOR AOP
• Provides cross cutting concerns
• Creates cleaner and reusable code
Common purposes of usage
⮚Security
⮚Transactions
⮚Logging
• Increases the understanding of code functionality
• Aspect weaver- weaves the aspects and the core
modules
BASIC TERMINOLOGIES OF AOP
• Aspects- part of the application which cross-cuts
the core concerns of multiple objects
• Join point- behaviours such as exception handling,
method execution changing object variable values
can be added
• Advice- action taken by an aspect at a particular
join point, executed before or after join point is
reached
• Pointcuts- determines at which join points advice
should be applied
• AOP doesn’t replace OOP but enhances it
• Can utilize AOP and OOP at the same time
⮚Flow of program execution- determined by
events
⮚Designed to detect events as they occur
and handle them by Event Handling
Procedure
⮚Extension of interrupt driven programming
found in DOS, Embedded Systems
⮚Virtually all object-oriented and visual
languages support event-driven
programming.
⮚Visual basic, Visual C++ and Java are some
examples
VB is specifically designed for event driven
approach, provides IDE
Being an IDE, VB provides much of the code for
detecting events automatically that the
programmer designs interface design and other
event handling code
BACKGROUND
• Before the evolution- Procedural program,
program flow- determined by the
programmer
• Modern event driven program- no discernible
control flow
• Event-loop waits for an event to occur, and
then invokes the appropriate event-handling
routine.
• Code for the event loop provided by event-
development environment
• The change from procedural to event driven is
accelerated by the introduction of Graphical
User Interface(GUI)
• Emerged during the introduction of Object
Oriented Programming in late 1970s.
• As database approach were introduced in this
era, the software provides user interface and
set of event handling procedures to deal with
queries and updates
WORKING OF EVENT DRIVEN
PROGRAMMING
• Central element of event driven application- Scheduler
• Determines the event type and calls the appropriate
event handler
• Event handlers- Blocks of procedural code deals with
very specific occurrence
• Produces visual response and changes the system’s
state
• State changes encompasses both data used and user
interface
• Event handlers also triggers other event to occur
(i.e.)it invokes second event handler and so on
• Event handlers can also discard the series of
events
EVENT QUEUE
• Series of events can’t be processed at the same
time
• Event queue- events handled as they front of the
queue
• Priority scheme- fast tracking of events by the
scheduler
• Length of the queue, time taken to process events
depends on the processor speed, amount of
installed RAM and the other applications running
at the same time.
IMPERATIVE PARADIGM Vs
DECLARATIVE PARADIGM
IMPERATIVE PARADIGM
Tells program “HOW” to do something
Explains how exactly to achieve the result
Provides more flexibility but sometimes involves complexity
Example snippet
Var numbers=[1,2,3];
Var doubledNumbers= [];
for(var i=0;i<numbers.length;++i)
{
doubledNumbers.push(numbers[i]*2);
}
console.log(doubledNumbers) ------> {2,4,6}
Here, each and every of the step is given a condition such as initialization,condition
checking and pushing value to a new array. This is the strategy involved in imperative
paradigm.
IMPERATIVE PARADIGM Vs
DECLARATIVE PARADIGM
DECLARATIVE PARADIGM
Declarative paradigm expresses the logic of a computation without describing its control
flow
It provides simplicity and hides complexity
Example snippet
Var Numbers=[1,2,3];
Var doubleNumbers= numbers.map (function(number))
{
return number *2;
}
console.log(doubledNumbers)--------> {2,4,6}
Here, map function acts as a kind of abstraction that knows how to iterate over an array
and push items into new array before returning the computed array.
This kind of programming increases the readability and compactibility of the program.
THANK YOU!

Más contenido relacionado

La actualidad más candente

Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and FlowchartsDeva Singh
 
7 expressions and assignment statements
7 expressions and assignment statements7 expressions and assignment statements
7 expressions and assignment statementsMunawar Ahmed
 
Variables & Data Types In Python | Edureka
Variables & Data Types In Python | EdurekaVariables & Data Types In Python | Edureka
Variables & Data Types In Python | EdurekaEdureka!
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchartRabin BK
 
Programming paradigm
Programming paradigmProgramming paradigm
Programming paradigmbusyking03
 
Principles of programming languages. Detail notes
Principles of programming languages. Detail notesPrinciples of programming languages. Detail notes
Principles of programming languages. Detail notesVIKAS SINGH BHADOURIA
 
Heuristics Search Techniques in AI
Heuristics Search Techniques in AI Heuristics Search Techniques in AI
Heuristics Search Techniques in AI Bharat Bhushan
 
Algorithm Design & Implementation
Algorithm Design & ImplementationAlgorithm Design & Implementation
Algorithm Design & ImplementationGaditek
 
COMPUTER HARDWARE AND SOFTWARE
COMPUTER HARDWARE AND SOFTWARECOMPUTER HARDWARE AND SOFTWARE
COMPUTER HARDWARE AND SOFTWARELibcorpio
 
Computer Organization and Assembly Language
Computer Organization and Assembly LanguageComputer Organization and Assembly Language
Computer Organization and Assembly Languagefasihuddin90
 
Object oriented programming in python
Object oriented programming in pythonObject oriented programming in python
Object oriented programming in pythonnitamhaske
 
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAChapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAMaulik Borsaniya
 

La actualidad más candente (20)

Introduction to problem solving in C
Introduction to problem solving in CIntroduction to problem solving in C
Introduction to problem solving in C
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and Flowcharts
 
7 expressions and assignment statements
7 expressions and assignment statements7 expressions and assignment statements
7 expressions and assignment statements
 
Variables & Data Types In Python | Edureka
Variables & Data Types In Python | EdurekaVariables & Data Types In Python | Edureka
Variables & Data Types In Python | Edureka
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
"MOUSE" HARDWARE
"MOUSE" HARDWARE "MOUSE" HARDWARE
"MOUSE" HARDWARE
 
Programming paradigm
Programming paradigmProgramming paradigm
Programming paradigm
 
Principles of programming languages. Detail notes
Principles of programming languages. Detail notesPrinciples of programming languages. Detail notes
Principles of programming languages. Detail notes
 
Heuristics Search Techniques in AI
Heuristics Search Techniques in AI Heuristics Search Techniques in AI
Heuristics Search Techniques in AI
 
Algorithm Design & Implementation
Algorithm Design & ImplementationAlgorithm Design & Implementation
Algorithm Design & Implementation
 
A tutorial on C++ Programming
A tutorial on C++ ProgrammingA tutorial on C++ Programming
A tutorial on C++ Programming
 
C PROGRAMMING
C PROGRAMMINGC PROGRAMMING
C PROGRAMMING
 
Lecture 4 means end analysis
Lecture 4 means end analysisLecture 4 means end analysis
Lecture 4 means end analysis
 
COMPUTER HARDWARE AND SOFTWARE
COMPUTER HARDWARE AND SOFTWARECOMPUTER HARDWARE AND SOFTWARE
COMPUTER HARDWARE AND SOFTWARE
 
Computer Organization and Assembly Language
Computer Organization and Assembly LanguageComputer Organization and Assembly Language
Computer Organization and Assembly Language
 
Syntax analysis
Syntax analysisSyntax analysis
Syntax analysis
 
Object oriented programming in python
Object oriented programming in pythonObject oriented programming in python
Object oriented programming in python
 
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAChapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
 
Python: Polymorphism
Python: PolymorphismPython: Polymorphism
Python: Polymorphism
 

Similar a Programming language paradigms

JAVA object oriented programming (oop).ppt
JAVA object oriented programming (oop).pptJAVA object oriented programming (oop).ppt
JAVA object oriented programming (oop).pptAliyaJav
 
Concurrency Programming in Java - 01 - Introduction to Concurrency Programming
Concurrency Programming in Java - 01 - Introduction to Concurrency ProgrammingConcurrency Programming in Java - 01 - Introduction to Concurrency Programming
Concurrency Programming in Java - 01 - Introduction to Concurrency ProgrammingSachintha Gunasena
 
object oriented programming examples
object oriented programming examplesobject oriented programming examples
object oriented programming examplesAbdii Rashid
 
Parallel language and compiler
Parallel language and compilerParallel language and compiler
Parallel language and compilerSVijaylakshmi
 
java tutorial for beginners learning.ppt
java tutorial for beginners learning.pptjava tutorial for beginners learning.ppt
java tutorial for beginners learning.pptusha852
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programmingAmar Jukuntla
 
Object Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft DeveloperObject Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft DeveloperLee Greffin
 
Autoframework design
Autoframework designAutoframework design
Autoframework designForge Events
 
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTSE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTnikshaikh786
 
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxshashiden1
 
Software engineering.pptx
Software engineering.pptxSoftware engineering.pptx
Software engineering.pptxJAGADEESWARIS6
 

Similar a Programming language paradigms (20)

Oop.pptx
Oop.pptxOop.pptx
Oop.pptx
 
Unit 2.pptx
Unit 2.pptxUnit 2.pptx
Unit 2.pptx
 
Unit 2.pptx
Unit 2.pptxUnit 2.pptx
Unit 2.pptx
 
[OOP - Lec 03] Programming Paradigms
[OOP - Lec 03] Programming Paradigms[OOP - Lec 03] Programming Paradigms
[OOP - Lec 03] Programming Paradigms
 
General oop concept
General oop conceptGeneral oop concept
General oop concept
 
JAVA object oriented programming (oop).ppt
JAVA object oriented programming (oop).pptJAVA object oriented programming (oop).ppt
JAVA object oriented programming (oop).ppt
 
Concurrency Programming in Java - 01 - Introduction to Concurrency Programming
Concurrency Programming in Java - 01 - Introduction to Concurrency ProgrammingConcurrency Programming in Java - 01 - Introduction to Concurrency Programming
Concurrency Programming in Java - 01 - Introduction to Concurrency Programming
 
object oriented programming examples
object oriented programming examplesobject oriented programming examples
object oriented programming examples
 
Parallel language and compiler
Parallel language and compilerParallel language and compiler
Parallel language and compiler
 
Basic concepts of oops
Basic concepts of oopsBasic concepts of oops
Basic concepts of oops
 
OOP-1.pptx
OOP-1.pptxOOP-1.pptx
OOP-1.pptx
 
java tutorial for beginners learning.ppt
java tutorial for beginners learning.pptjava tutorial for beginners learning.ppt
java tutorial for beginners learning.ppt
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programming
 
Object Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft DeveloperObject Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft Developer
 
Autoframework design
Autoframework designAutoframework design
Autoframework design
 
Coding
CodingCoding
Coding
 
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTSE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
 
Unit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptxUnit 1 introduction to c++.pptx
Unit 1 introduction to c++.pptx
 
Software engineering.pptx
Software engineering.pptxSoftware engineering.pptx
Software engineering.pptx
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 

Más de Ashok Raj

Manipulators in c++
Manipulators in c++Manipulators in c++
Manipulators in c++Ashok Raj
 
How c++ stored in ram
How c++ stored in ramHow c++ stored in ram
How c++ stored in ramAshok Raj
 
Command line arguments
Command line argumentsCommand line arguments
Command line argumentsAshok Raj
 
High Performance Computer
High Performance ComputerHigh Performance Computer
High Performance ComputerAshok Raj
 
Super computers
Super computersSuper computers
Super computersAshok Raj
 
Pros and cons of c as a compiler language
  Pros and cons of c as a compiler language  Pros and cons of c as a compiler language
Pros and cons of c as a compiler languageAshok Raj
 
Printers and its types
Printers and its typesPrinters and its types
Printers and its typesAshok Raj
 
Microprocessor
MicroprocessorMicroprocessor
MicroprocessorAshok Raj
 
Mother board
Mother boardMother board
Mother boardAshok Raj
 
Embedded systems
Embedded systemsEmbedded systems
Embedded systemsAshok Raj
 
FULL stack -> MEAN stack
FULL stack -> MEAN stackFULL stack -> MEAN stack
FULL stack -> MEAN stackAshok Raj
 

Más de Ashok Raj (11)

Manipulators in c++
Manipulators in c++Manipulators in c++
Manipulators in c++
 
How c++ stored in ram
How c++ stored in ramHow c++ stored in ram
How c++ stored in ram
 
Command line arguments
Command line argumentsCommand line arguments
Command line arguments
 
High Performance Computer
High Performance ComputerHigh Performance Computer
High Performance Computer
 
Super computers
Super computersSuper computers
Super computers
 
Pros and cons of c as a compiler language
  Pros and cons of c as a compiler language  Pros and cons of c as a compiler language
Pros and cons of c as a compiler language
 
Printers and its types
Printers and its typesPrinters and its types
Printers and its types
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
Mother board
Mother boardMother board
Mother board
 
Embedded systems
Embedded systemsEmbedded systems
Embedded systems
 
FULL stack -> MEAN stack
FULL stack -> MEAN stackFULL stack -> MEAN stack
FULL stack -> MEAN stack
 

Último

Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxAS Design & AST.
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdfAndrey Devyatkin
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfPros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfkalichargn70th171
 
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdfSteve Caron
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
Understanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptxUnderstanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptxSasikiranMarri
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...kalichargn70th171
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Advantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxAdvantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxRTS corp
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 

Último (20)

Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptx
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfPros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
 
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
Understanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptxUnderstanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptx
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Advantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxAdvantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptx
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 

Programming language paradigms

  • 2. WHAT IS PARADIGM? It’s a way (or) style of thinking to solve a problem! WHAT IS PROGRAMMING LANGUAGE PARADIGM? A programming language paradigm is a way in which computer language looks at the problem to be solved
  • 3. TYPES OF PROGRAMMING LANGUAGE PARADIGM: IMPERATIVE PARADIGM DECLARATIVE PARADIGM PROCEDURAL OBJECT ORIENTED PROGRAMMING PARALLEL PROCESSING LOGIC FUNCTIONAL DATABASE
  • 4. WHY DO WE NEED SO MANY PARADIGMS? • Each problem requires a different way of approach. • To facilitate the different styles of approach we need different paradigms. • For ex: some problem requires mathematical model and a clear flow to denote how to find a solution; • While, some problems just require a solution
  • 5. Which to learn first? Language or paradigm • Before learning any subject we must learn it’s paradigm first. • This allows us to code the language in a way the compiler assumes flow of control and give an optimized coding.
  • 6. IMPERATIVE PARADIGM It is the form and style of programming in which we care about “how” we get to an answer, step by step process. Instructing the computer to perform in certain way to solve a task.
  • 7.
  • 8. Declarative Programming Paradigm: • This is the form or style of programming where we are most concerned with “what” we want as the answer, or what would be returned. • Declarative code focuses on building logic of software without actually,describing its flow. • Eg: <Img src=”./image.jpg”/> • HTML,XML,CSS,SQL,Prolong,Haskell,F# and Lisp belongs under declarative paradigm.
  • 9. • Programs written this way often compile to binary executables that run more efficiently. Eg: CPU instructions are imperative statements. • To make programs simpler to understand, statements have been grouped into sections using blocks. Eg: c,c++,c#,java
  • 10. PROCEDURAL PROGRAMMING PARADIGM: • writing down instructions step-by-step to get final result • procedural code directly instructs a device on how to finish a task in logical steps • linear top-down approach • treats data and procedures as two different entities • divides the program into procedures, which are also known as routines or functions, simply containing a series of steps to be carried out
  • 11. PROCEDURAL PROGRAMMING PARADIGM: • third-generation languages • contrasted with is event-driven programming • procedures are called/executed only in response to events • events are unpredictable • the procedures that handle them cannot be executed linearly as is the case with procedural programming
  • 12. Key Features of Procedural Programming • Predefined functions • Local Variable • Global Variable • Modularity • Parameter Passing
  • 13. Procedural Programming Languages • COmmon Business Oriented Language (COBOL) • FORmula TRANslation (FORTRAN) • ALGOrithmic Language (ALGOL) • Programming Language One (PL/I) • Beginners All purpose Symbolic Instruction Code (BASIC) • C
  • 14. Parallel computing • is a type of computation in which many calculations or the execution of processes are carried out simultaneously • it is the use of multiple processing elements simultaneously for solving any problem. Problems are broken down into instructions and are solved concurrently as each resource which has been applied to work is working at the same time
  • 15. PARALLEL COMPUTING • people standing in a queue waiting for movie ticket and there is only cashier. Cashier is giving ticket one by one to the persons. Complexity of this situation increases when there are 2 queues and only one cashier • the complexity will decrease when there are 2 queues and 2 cashier giving tickets to 2 persons simultaneously. This is an example of Parallel Computing.
  • 16. Why parallel computing? • real world runs in dynamic nature • real data needs more dynamic simulation and modeling, and for achieving the same, parallel computing is the key • provides concurrency and saves time and money • complex, large datasets, and their management can be organized • ensures the effective utilization of the resources • hardware is guaranteed to be used effectively • it is impractical to implement real-time systems using serial computing
  • 17. Limitations of parallel Computing • communication and synchronization between multiple sub-tasks and processes which is difficult to achieve • algorithms must be managed so they can be handled in the parallel mechanism. • the algorithms or program must have low coupling and high cohesion. But it’s difficult to create such programs. • skilled and expert programmers can code a parallelism based program well.
  • 18. APPLICATIONS • Databases and Data mining. • Real time simulation of systems. • Science and Engineering. • Advanced graphics, augmented reality and virtual reality
  • 19. OBJECT-ORIENTED PROGRAMMING Based on objects data methods Aims to incorporate advantages of modularity and reusability Objects instances of classes can interact with each other. Ex: C++,Java,Python,Ruby, etc.
  • 20. THE IMPORTANT FEATURES OF OBJECT– ORIENTED PROGRAMMING ARE • Bottom–up approach in program design • Programs organized around objects, grouped in classes • Focus on data with methods to operate upon object’s data • Interaction between objects through functions • Reusability of design through creation of new classes by adding features to existing classes
  • 21. THE BASIC CONCEPTS INVOLVED IN OBJECT ORIENTED APPROACH INCLUDE • Class • Object • Attributes • Methods • Inheritance • Abstraction • Encapsulation and Information hiding • Polymorphism
  • 22. CLASS • Abstract data type • Blueprint describing the nature of something • Data structure may contain different fields • Object defined to contain procedures that act on it. Attributes operations /fields /methods
  • 23. OBJECT • An induvidual of a class created @ run-time from a class • Object state.->{values} of attributes of a particular object • Behaviour defined in class • Initialized by implicitly calling its constructor • One of the member function.
  • 24. ATTRIBUTES • Data members/ member variables • Data encapsulated within a class or object • Attributes object’s variables Initialized using constructor On further excecution, will represent the state of object
  • 25. INHERITANCE • Compartmentalizes, hence code is reusable • By creating collections of attributes & behaviours, based on prev defined classes • New classes, (a.k.a. subclasses) inherits attributes & behaviours of Super class(es). • This inheritance relationship gives rise to an Hierarchy • Single class can inherit from 2 classes that have members bearing the same names_ but different meaning.
  • 26. ABSTRACTION • Simplifying a complex reality by Modelling classes appropriate to the problem • OOP provides abstraction through composition &inheritance • CLASS CAR {engine,gearbox,steering} • To drive we don’t need to know how diff components work internally, we just need to interface with (by sending and receiving messages from) them.
  • 27. ENCAPSULATION AND INFORMATION HIDING • Bundling of data members & member fn() • Choosing whether to either expose or hide some of the members of a class • Achieved by specifying which classes may use the members • Prevents Unauthorized objects to change the state of an object
  • 28. POLYMORPHISM • Poly-many morphs-forms • Ability of a message to be displayed in more than one form. Father • A man husband Employee • Same person posses different behaviour in different situations • One interface- multiple implentations
  • 29. TYPES OF DECLARATIVE PARADIGM • LOGIC PARADIGM • FUNCTIONAL PARADIGM • DATABASE PARADIGM
  • 30. LOGIC PARADIGM • Logic paradigm program statements express facts and rules about problems within a system of formal logic. • A logical program is divided into three sections: • (i) A series of definitions that define the problem domain • (ii) Reports of relevant facts. • (iii) Declaration of aims in the form of a request Any deducible answer to a query is returned. The definitions and declarations are built entirely from relations.
  • 31. ADVANTAGES OF LOGICAL PROGRAMMING • The advantages of logic oriented programming are : • (i) The system solves the problem thus the programming steps themselves are kept to a minimum. • (ii) Demonstrating the rationality of a given program is quite easy.
  • 32. LANGUAGES USING LOGIC PARADIGM • Datalog • ASP • prolog
  • 33. FUNCTIONAL PARADIGM • The key principal of this paradigms is the execution of series of mathematical functions • Function can be replaced with their values without changing the meaning of the program. • The Functional Programming paradigm uses mathematical functions. With this, operations are performed based solely based on the inputs into the program, and does not rely on temporary (or hidden) variables in with which to store results between inputs.
  • 34. ADVANTAGE OF FUNTIONAL PARADIGM • code more readable and easily understandable • testing and debugging is easier • Used to implement concurrency because pure function does not change variables • Values are stored and used only when it is needed • Functional Languages provide a protected environment. • Due to functional programming depends only on the arguments input to the function; it does not suffer from side effects.
  • 35. DISADVANTAGE OF FUNCTIONAL PARADIGM • Recursion can lead to decrease in performance • Functional programming can be less efficient than other languages. • They tend to require a large amount of time and memory. • Purely Functional Languages are not really used in commercial software development because WRITING pure functions are difficuilt to combine.
  • 36. PROGRAMMING LANGUAGE USING FUNCTIONAL PARADIGM • Haskell • JavaScript • Scala • Lisp • ML • Clojure • Common Lisp
  • 37. DATABASE/DATA DRIVEN PROGRAMMING APPROACH • Database programming methodology is based on data and its movement. • Program statements are defined by data • A database program is the heart of a business information system and provides file creation, data entry, update, query and reporting functions.
  • 38. DATABASE OR DATADRIVEN PROGRAMMING LANGUAGE • AWK • Oz • Perl – data-driven programming as in AWK and sed is one paradigm supported by Perl • sed • Lua • Clojure
  • 39. ADVANTAGES OF DATABASE PARADIGM • Functionality simply requires that it knows the abstract data type of the variables it is working with. • Functions and interfaces can be used on all objects with the same data field • Can grouped data of any objects or entities without consequences
  • 40. DISADVANTAGE OF DATABASE PARADIGM • When dealing with the abstract data types can lead to bad object oriented programming • Any attempt to change the structure of the object would immediately break the functions
  • 41. MINOR PARIDIGMS • 2 Types • Aspect Oriented Programming • Event-Driven Programming
  • 42. ASPECT ORIENTED PROGRAMMING • AOP complementary to OOP • AOP: Modularizes code into several processes; OOP: Modularises code to objects • Provides programmers the separation of concern, facilitates several cross cutting concerns • Adds additional behaviour to the code without modifying the code
  • 43. NEED FOR AOP • Provides cross cutting concerns • Creates cleaner and reusable code Common purposes of usage ⮚Security ⮚Transactions ⮚Logging • Increases the understanding of code functionality • Aspect weaver- weaves the aspects and the core modules
  • 44.
  • 45. BASIC TERMINOLOGIES OF AOP • Aspects- part of the application which cross-cuts the core concerns of multiple objects • Join point- behaviours such as exception handling, method execution changing object variable values can be added • Advice- action taken by an aspect at a particular join point, executed before or after join point is reached • Pointcuts- determines at which join points advice should be applied
  • 46. • AOP doesn’t replace OOP but enhances it • Can utilize AOP and OOP at the same time
  • 47. ⮚Flow of program execution- determined by events ⮚Designed to detect events as they occur and handle them by Event Handling Procedure ⮚Extension of interrupt driven programming found in DOS, Embedded Systems ⮚Virtually all object-oriented and visual languages support event-driven programming. ⮚Visual basic, Visual C++ and Java are some examples
  • 48. VB is specifically designed for event driven approach, provides IDE Being an IDE, VB provides much of the code for detecting events automatically that the programmer designs interface design and other event handling code
  • 49. BACKGROUND • Before the evolution- Procedural program, program flow- determined by the programmer • Modern event driven program- no discernible control flow • Event-loop waits for an event to occur, and then invokes the appropriate event-handling routine. • Code for the event loop provided by event- development environment
  • 50. • The change from procedural to event driven is accelerated by the introduction of Graphical User Interface(GUI) • Emerged during the introduction of Object Oriented Programming in late 1970s. • As database approach were introduced in this era, the software provides user interface and set of event handling procedures to deal with queries and updates
  • 51. WORKING OF EVENT DRIVEN PROGRAMMING • Central element of event driven application- Scheduler • Determines the event type and calls the appropriate event handler • Event handlers- Blocks of procedural code deals with very specific occurrence • Produces visual response and changes the system’s state • State changes encompasses both data used and user interface • Event handlers also triggers other event to occur (i.e.)it invokes second event handler and so on
  • 52. • Event handlers can also discard the series of events
  • 53. EVENT QUEUE • Series of events can’t be processed at the same time • Event queue- events handled as they front of the queue • Priority scheme- fast tracking of events by the scheduler • Length of the queue, time taken to process events depends on the processor speed, amount of installed RAM and the other applications running at the same time.
  • 54. IMPERATIVE PARADIGM Vs DECLARATIVE PARADIGM IMPERATIVE PARADIGM Tells program “HOW” to do something Explains how exactly to achieve the result Provides more flexibility but sometimes involves complexity Example snippet Var numbers=[1,2,3]; Var doubledNumbers= []; for(var i=0;i<numbers.length;++i) { doubledNumbers.push(numbers[i]*2); } console.log(doubledNumbers) ------> {2,4,6} Here, each and every of the step is given a condition such as initialization,condition checking and pushing value to a new array. This is the strategy involved in imperative paradigm.
  • 55. IMPERATIVE PARADIGM Vs DECLARATIVE PARADIGM DECLARATIVE PARADIGM Declarative paradigm expresses the logic of a computation without describing its control flow It provides simplicity and hides complexity Example snippet Var Numbers=[1,2,3]; Var doubleNumbers= numbers.map (function(number)) { return number *2; } console.log(doubledNumbers)--------> {2,4,6} Here, map function acts as a kind of abstraction that knows how to iterate over an array and push items into new array before returning the computed array. This kind of programming increases the readability and compactibility of the program.