A Computer Program is a precise, ordered sequence of instructions written in a specific computer language that directs the computer hardware to perform a defined task or solve a computational problem. The creative and logical process of designing, writing, testing, and debugging these instructions is called Programming (or coding). The individual who writes and implements these instructions is called a Programmer.
Because computer processors (CPUs) consist of millions of microscopic electronic switches (transistors) that operate strictly through two physical voltage states (ON = 1, OFF = 0), human programmers require formal communication systems—known as Programming Languages—to bridge human thought and electronic hardware.
Machine Language is the fundamental, native language of a computer system. It is written exclusively using binary digits: 0 and 1 (binary code). For example, an instruction to add two numbers might appear as a cryptic binary string like 01001100 00010001.
- Key Advantages: Fastest possible execution speed, zero translation overhead (directly executed by CPU registers), and extremely efficient hardware utilization.
- Severe Limitations: Highly machine-dependent (a program written for one CPU architecture will not run on another), nearly impossible for humans to memorize long binary strings, excruciatingly difficult to debug, and prone to typing errors.
To overcome the immense difficulty of binary code, computer scientists created Assembly Language. Instead of numeric 0s and 1s, Assembly language substitutes short, memorable English abbreviations called Mnemonics (e.g., ADD for addition, SUB for subtraction, MOV for moving data between registers, JMP for jump, and HLT for halt).
Because the CPU still only understands binary signals, Assembly language requires a dedicated system software translator called an Assembler to convert mnemonic code into machine language. Although vastly easier than binary, Assembly language remains low-level and machine-dependent, requiring deep knowledge of specific CPU hardware registers.
High-Level Languages (HLL) revolutionized computing by using everyday English words (such as PRINT, INPUT, IF, THEN, GOTO) and familiar mathematical operators (+, -, *, /). High-level languages are machine-independent (portable)—a program written in a high-level language can run on virtually any computer hardware equipped with the appropriate language translator.
- Historical Milestones: FORTRAN (Formula Translation, 1957 by John Backus) was the world's first high-level language, designed for scientific calculations; COBOL (Common Business-Oriented Language, 1959 by Grace Hopper) was created for business applications; BASIC (Beginners All-purpose Symbolic Instruction Code, 1964 by Kemeny & Kurtz) was built for teaching novices. Modern 3GLs include C, C++, Java, and Python.
Fourth Generation Languages (4GL) are non-procedural languages designed to maximize programming speed and human productivity. In a procedural language (like C or BASIC), the programmer must specify how to accomplish a task step-by-step. In a 4GL, the programmer simply specifies what result is desired, and the system figures out how to retrieve it. The most prominent example of a 4GL is SQL (Structured Query Language), used worldwide to query relational databases.
Fifth Generation Languages (5GL) incorporate artificial intelligence and constraint-based programming, where problems are solved using natural language queries and logical constraints rather than coded algorithms (e.g., Prolog, Mercury).