The art of composing computer programs.
A set of rules governing a computational process, and is meant to be run by a computer to achieve the required output(results), when given a suitable set of input.
INPUT —> PROGRAM —> OUTPUT
Input goes in, and output comes out. Programs are deterministic.
A computer program is made of 2 classes of objects:
A function/procedure is a block of code or is a smaller program that is contained within a program, that is deviced to perform a particular sub-task or a particular subset of a computation. A function is also known as a subroutine
A Function is like a paragraph in an essay. It is a cohesive subunit that tackles a particular sub-task of an emergent program.
It’s interesting to note that a program itself can be seen as a function or subroutine in a larger system.
An example is the Microsoft Office Suite. Ms Excel is a spread sheet program, but at higher levels, it can be seen as a function that permits spreadsheet editing in the emergent Ms Office Suite.
Data are the values or valuable objects that are manipulated as the functions encircled in a program are running. As functions or programs evolve, they mutate of manipulate information called data. These pieces of information or data are stored in registers or computer memory units known at higher levels as variables.
No matter what program we are looking at, it will be built from functions and data objects. Terminology might vary, but the underlying concepts remain data and functions/procedures.
Programs are built by composing functions, and data objects in containers called variables.
In some programming environments, there is no difference between functions and data objects, because both functions and data objects can be similarly manipulated.
In a nutshell, programming is about composing a framework of coherent functions and data structures that collectively and effectively solve a given computational problem.
Composition through abstraction.
Abstraction is the process of composing or desingating a class of related objects so as to secure a single umbrella unit that can be skillfully treated as one, without bothering about any particular one, but efficiently tackling all members of the unit.
2 types of abstractions are observed in programming.
Both types of abstraction entail creating primitives and combining them to form desired layers.
Procedural abstraction entails building composite procedures by combining primtive procedures using:
Data abstraction entails building composite data objects using:
So programming is about functions and data.