1-Introduction To OOP
1-Introduction To OOP
Programming
Contents
• Brief history of computer programming
• Procedural programming
• Object-oriented programming
2
Computer Programming
3
Programming Languages
Three main categories:
• Machine languages
• Low-level assembly languages
• High-level programming languages
4
Machine Languages
• Composed of 0 and 1
• Is the “native” language of a computer, but difficult to program
• Example of machine codes:
5
Assembly Languages
• Computer instructions are represented in
symbolic codes
• Needs to be translated into machine codes
before processing
• Example of assembly codes:
6
High-level Languages
• Syntax is similar to human languages
• Need to be compiled into machine codes for
executing
• Example of high-level codes:
8
Procedural Programming
• Procedural programming is a programming paradigm where
program contains a sequential sets of computational/linear
commands to be carried out by the computer
9
Procedural Programming
• In procedural programming, computer program is
divided into small parts called functions
10
Example of Procedural Programming
12
Object-Oriented Programming
• OOP is a programming an object
paradigm where computer Data
program is divided into Method 1 Method 2 Method 3
parts called objects
• Key idea:
“The real world can be
Method 1 Method 2 Method 3
described as a collection of
objects that interact” Data
another object
13
Object-Oriented Programming
• In OOP, object is a “thing” that includes both
data (properties) and functions (methods)
14
OOP Languages
• In OOP languages, programmers create programs
using “blueprints” of data models called classes
15
Example of OOP Languages
16
Example of OOP Languages
17
18