Chapter 5: Concept of Programming
Introduction
Programming is the process of writing
instructions for a computer to perform specific tasks. These instructions are
written in programming languages, which can be categorized into high-level,
low-level, and assembly languages. This chapter will cover the definitions and
examples of instructions and programs, the concept of programming languages,
procedural and non-procedural programming, structured programming, and
object-oriented programming.
Instruction
Definition
An instruction is a single operation or command
that tells the computer what to do. Instructions are the basic building blocks
of a program.
Program
Definition
A program is a set of instructions that a
computer follows to perform a specific task. Programs can range from simple
scripts to complex applications.
Programming Language
Concept
A programming language is a formal language
comprising a set of instructions that produce various kinds of output.
Programming languages are used to implement algorithms.
High-Level Language
High-level languages are closer to human
languages and are more abstract from the machine's hardware. They are easier to
write, read, and maintain. Examples include Python, Java, and C++.
Low-Level
Language
Low-level languages are closer to machine
language and provide little or no abstraction from the computer's hardware.
They are harder to write and understand but offer more control over the
hardware. An example is Assembly language.
Assembly
Language
Assembly language is a low-level language that
uses symbolic names to represent machine-level code. Each assembly language
instruction corresponds to a machine language instruction.
Procedural and Non-Procedural Programming
Procedural Programming
Procedural programming is a programming paradigm
based on the concept of procedure calls, where the program is divided into
procedures or functions. Each procedure performs a specific task.
Non-Procedural Programming
Non-procedural programming, also known as
declarative programming, focuses on what the program should accomplish rather
than how to accomplish it. Examples include SQL and Prolog.
Concept
of Structured Programming
Structured programming is a programming paradigm
aimed at improving the clarity, quality, and development time of a software
program by making extensive use of subroutines, block structures, and loops. It
emphasizes breaking down a program into small, manageable sections.
Object-Oriented Programming (OOP)
Object-Oriented Programming (OOP) is a
programming paradigm based on the concept of "objects", which are
instances of classes. It focuses on data (objects) and the methods that operate
on the data. The main principles of OOP are encapsulation, inheritance, and
polymorphism.
Encapsulation
Encapsulation is the concept of bundling the
data (attributes) and the methods (functions) that operate on the data into a
single unit called a class.
Inheritance
Inheritance is the mechanism by which one class
(child class) can inherit the properties and methods of another class (parent
class).
Polymorphism
Polymorphism allows methods to do different
things based on the object it is acting upon, even though they share the same
name.
Conclusion
Understanding the concept of programming, from
basic instructions to complex programming paradigms like object-oriented
programming, is essential for developing efficient and effective software. This
chapter provided an overview of different programming concepts with examples to
help you grasp the fundamentals.
References
1. Introduction to the Theory of Computation by
Michael Sipser
2. Programming: Principles and Practice Using
C++ by Bjarne Stroustrup
3. Python Programming: An Introduction to
Computer Science by John Zelle
4. Structured Computer Organization by Andrew S.
Tanenbaum
5. The Art of Assembly Language by Randall Hyde
Comments
Post a Comment