Home About

What is Programming?

The art of composing computer programs.

What is a computer program?

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.

What is a computer program made of?

A computer program is made of 2 classes of objects:

Functions:

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

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.

Program = Functions + Data

A running program is a process, or a process is a program that is running.

Truth

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.

How are programs built?

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.

Core programming practice

Composition through abstraction.

What is 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.

How is abstraction achieved

2 types of abstractions are observed in programming.

  1. Procedural abstraction
  2. Data abstraction

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?

So programming is about functions and data.

Fork me on GitHub