Bytesveda

Fundamentals of Computer Science

Programming – Program

Program

The word “program” is both a noun and a verb.

As a noun, the code or set of instructions that gets run by a computer is called a Program.

As a verb, it’s the action of writing the instructions commonly known as “coding”, or configuring a machine, as in, “Can you program this device to light up every 2 minutes?”

A Program, a set of instructions called code, is written per the rules or syntax of a programming language.

How does the machine “understand” a program instruction?

Have you seen a lighthouse? Its purpose is to send messages to ships. How does it communicate a message to a ship? They use flash (on/off) patterns. Each flash pattern like On Off On Off stands for a unique message like “Stay Away” or “All Clear”, that navigators on the ship can use.

You can’t instruct a computer like you would with a person. (although Alexa and Siri might make you think otherwise, they actually use AI technology). Computer processors can detect just 2 states – On / Off or 1 / 0. When electricity flows through a circuit, it’s On or a 1 and when it’s not, it’s 0 or Off.

Just like how a lighthouse uses combination of light flashes and pauses to send a message, different patterns of 0s and 1s allows to create instructions for the computer. Every unit of 0/1 is called a bit.

Programming Languages

So if we are to communicate with the computer, should we learn the on-off bit patterns? Not really. Early pioneers came up with a way to write a program in English-like words and commands making it easier for us to write code using programming languages which we will look at in the next topic.

A programming language enables you to write code that can then be executed by the computer. There are several different programming languages in the computer world, just like there are many languages in the real world. Examples of programming languages are Java, Python, C#, and COBOL.

This image has an empty alt attribute; its file name is SW3.jpg
Compiler is a software whose main purpose is to convert high-level program code to machine-readable low-level code.

Summary

Unlike pseudocode, a program or code is written using the rules (syntax) of a programming language.