Computer
Quarter 1
programming
Theoretical
BACKGROUNDS
AND PRINCIPLES
GOVERNING
PROGRAMMING
LANGUAGES
Programming concepts and paradigms
Millions of programming languages have
been invented, and several thousands of
them are actually in use. Compared to
natural languages that developed and
evolved independently, programming
languages are far more similar to each
other. This is because
different programming languages share the same
mathematical foundation (e.g., Boolean algebra, logic);
they provide similar functionality (e.g., arithmetic,
logic operations, and text processing);
they are based on the same kind of hardware and
instruction sets;
they have common design goals: find languages that
make it simple for humans to use and efficient for
hardware to execute;
designers of programming languages share their design
experiences.
pARADIGM
In programming language’s definition,
paradigm is a set of basic principles,
concepts, and methods for how a
computation or algorithm is expressed. The
major paradigms we will study in this text
are imperative, object-oriented, functional,
and logic paradigms.
IMPERATIVE
Also called the procedural, programming
paradigm expresses computation by fully-
specified and fully-controlled manipulation
of named data in a stepwise fashion.
IMPERATIVE /
PROCEDURAL
DATA OR VALUES TAKEN OUT OF STORED BACK IN
ARE INITIALLY (READ FROM) THE SAME OR
STORED IN MEMORY, DIFFERENT
VARIABLES MANIPULATED IN VARIABLES
(MEMORY ALU (ARITHMETIC (MEMORY
LOCATION) LOGIC UNIT) LOCATIONS)
IMPERATIVE
The foundation of imperative languages is
the stored program concept – based
computer hardware organization and
architecture (von Neumann machine).
Typical imperative programming languages
include all assembly languages and earlier
high-level languages like Fortran, Algol,
Ada, Pascal, and C.
OBJECT-ORIENTED
Programming paradigm is basically the
same as the imperative paradigm, except
that related variables are organized into
classes of objects. The access privileges of
variables and methods (operation) in
objects can be defined to reduce (simplify)
the interaction among objects.
OBJECT-ORIENTED
C++ uses objects to model real-world
problems.
Unlike procedural programming, where
functions are written to perform operations
on data, OOP involves creating objects that
contain both DATA and FUNCTIONS.
OBJECTs
Are considered the main building blocks of
programs, which support the language
features like inheritance, class hierarchy,
and polymorphism. Typical object-oriented
programming languages include: Smaltalk,
C++, Java and C#.
OBJECTs
An object has two characteristics:
ATTRIBUTES and BEHAVIOR.
Ex. A car can be an object. And, it has
- Attributes – brand, model, size, mileage,
etc.
- Behavior – driving, acceleration,
parking, etc.
Class and object
functional
Also called the applicative, programming
paradigm expresses computation in terms
of mathematical functions.
ProgrammING
LANGUAGE
* A programming language allows people
to create programs that tell machines
(computers) what to do.
* A programming language is a tool for
developing executable models for a class of
problem domains.
LEVELS OF PROGRAMMING
LANGUAGE
PROGRAMMING
LANGUAGES?
• Imperative Programming (C)
• Object-Oriented Programming (C++)
• Logic/Declarative Programming
• (Prolog)
Functional / Applicative Programming
(Lisp)