Unit 1: Programming
Unit code: D/615/1618
Unit level: 4
Content Prepared by:
School of Computing and Informatics 1
2
Prepared by: Ms. Dania Alsaid, Ms. Hana Alrasheed
programming paradigm is a style, or “way,” of programming.
Some languages make it easy to write in some paradigms but not others.
Never use the phrase “programming language paradigm”.
A paradigm is a way of doing something (like programming), not a concrete
thing (like a programming language).
Prepared by: Ms. Dania Alsaid, Ms. Hana Alrasheed 3
Prepared by: Ms. Dania Alsaid, Ms. Hana Alrasheed 4
Prepared by: Ms. Dania Alsaid, Ms. Hana Alrasheed 5
Prepared by: Ms. Dania Alsaid, Ms. Hana Alrasheed 6
7
Prepared by: Ms. Dania Alsaid, Ms. Hana Alrasheed
▪ Procedural programming means a large program is broken down into smaller
manageable parts called procedures or functions.
Main
Program
The basic component of
the procedural paradigm
Function 1 Function 2 Function 3 is a Function/ Procedure
Prepared by: Ms. Dania Alsaid, Ms. Hana Alrasheed 8
▪ The procedural Paradigm uses a linear top-down approach
the program execution starts at the top and the program statements are
executed one after another.
The program is executed
line by line from top to
bottom
Prepared by: Ms. Dania Alsaid, Ms. Hana Alrasheed 9
▪ Instead of letting the main program do the whole job, the job is divided into tasks and
each task is assigned to a procedure (Function)
Each Function/
Procedure is responsible
for doing one task
Prepared by: Ms. Dania Alsaid, Ms. Hana Alrasheed 10
▪ Each function has its own data (variables) , that are only accessible inside the same function
where it was declared and initialized.
Function 1 Function 2
The local data of function
1 are not visible to
function 2 and vise
versa.
Local Local
Data Data
Prepared by: Ms. Dania Alsaid, Ms. Hana Alrasheed
11
▪ All functions can access the global data (variables) , declared and initialized outside functions
The local data of
functions are visible only
to the function itself but
the global data are
visible for all the
functions
12
Prepared by: Ms. Dania Alsaid, Ms. Hana Alrasheed
▪ Easy to learn by beginners.
▪ Straight forward program organization.
▪ The code can be reused in different parts of
the program, without the need to copy it- you
just call the procedure/ function.
▪ The program flow can be tracked easily.
Prepared by: Ms. Dania Alsaid, Ms. Hana Alrasheed 13
▪ It is not suitable for large and complex
projects.
▪ It focuses on functions and data is not getting
enough attention.
▪ Difficult to relate with real-world objects
Prepared by: Ms. Dania Alsaid, Ms. Hana Alrasheed 14
15
Prepared by: Ms. Dania Alsaid, Ms. Hana Alrasheed