Programming Models/ Paradigms Chapter 5: Programming Languages.
-
Upload
lionel-watkins -
Category
Documents
-
view
238 -
download
0
description
Transcript of Programming Models/ Paradigms Chapter 5: Programming Languages.
![Page 1: Programming Models/ Paradigms Chapter 5: Programming Languages.](https://reader036.fdocuments.net/reader036/viewer/2022082402/5a4d1b127f8b9ab059990375/html5/thumbnails/1.jpg)
Programming Models/
ParadigmsChapter 5: Programming
Languages
![Page 2: Programming Models/ Paradigms Chapter 5: Programming Languages.](https://reader036.fdocuments.net/reader036/viewer/2022082402/5a4d1b127f8b9ab059990375/html5/thumbnails/2.jpg)
What is a Programming Paradigm
A programming paradigm is a model , example or standard approach that has evolved different programming languages over a number of years.
We can basically divide all the languages into 4 models: Imperative Programming Model Declarative Functional Object-Oriented
![Page 3: Programming Models/ Paradigms Chapter 5: Programming Languages.](https://reader036.fdocuments.net/reader036/viewer/2022082402/5a4d1b127f8b9ab059990375/html5/thumbnails/3.jpg)
Imperative Programming Paradigm
Also known as Procedural paradigm represents the traditional programming process. It is based on Fetch-Decode and Execute cycle. It defines the programming process to be development of a sequence of commands that when followed manipulate data to produce the desired results. Thus it focuses on an approach to solve the problem
![Page 4: Programming Models/ Paradigms Chapter 5: Programming Languages.](https://reader036.fdocuments.net/reader036/viewer/2022082402/5a4d1b127f8b9ab059990375/html5/thumbnails/4.jpg)
Declarative Programming Approach
It emphasizes the question “What is the problem?” rather than “What algorithm is required for solving the problem?” Here a general problem solving approach is developed that can solve a number of problems. These languages are difficult to design and are special purpose by nature
PROLOG (Programming LOGic) is an example
![Page 5: Programming Models/ Paradigms Chapter 5: Programming Languages.](https://reader036.fdocuments.net/reader036/viewer/2022082402/5a4d1b127f8b9ab059990375/html5/thumbnails/5.jpg)
Functional Paradigm It views the process of program
development as construction of some small boxes called Methods or functions. Each of these box is provided a set of input values and by applying some transformation output is produced. This e.g Here Find_sum and
Find_Diff are functions that are performing certain transformations to get New_balance as output
![Page 6: Programming Models/ Paradigms Chapter 5: Programming Languages.](https://reader036.fdocuments.net/reader036/viewer/2022082402/5a4d1b127f8b9ab059990375/html5/thumbnails/6.jpg)
Object Oriented Paradigm
In this approach all real world things are considered as an object. Each object has a certain set of qualities/ attributes and each object can perform some job/method. Thus if I have an object CAR then Car has its color, engine#, make, model etc as attributes and its methods can be drive(), stop() etc
Examples include C++, Java etc