Study
CSC-202 route
Unit 1 · Lesson 1 of 3 13 min

What Is Programming

Turn requirements into instructions a computer can run.

A school wants report cards computed without errors. A shop wants stock counted without closing for a day. A hospital wants dosage reminders that never sleep.

Each of those is only a wish until someone converts it into exact steps a machine can carry out.

Programs and Programmers

A program is a set of instructions that tells the computer what to do. Every app on a phone, every timetable printer, and every bank alert is a program. Because a machine has no common sense, those instructions must be precise enough for it to follow to the letter.

A programmer, or software developer, is a person with the training and skills to design, create and test computer programs. The job covers understanding the task, writing the instructions, proving they work, and keeping them working as needs change. Programmers work across almost every industry because wherever a task repeats, software can automate it.

Languages and Translators: C++, Java and Python
LanguageHow It TranslatesWhere It Shines
C++A compiler converts the whole program into raw binary machine code before it runsFast, close to the hardware; used in games and operating systems
JavaCompiles source into portable bytecode, then runs it on a Java virtual machinePortable across different machines and operating systems
PythonAn interpreter executes code directly (CPython compiles source to bytecode internally and runs it on a virtual machine, with no separate build step)Readable and quick to write; popular for scripting, web backends, data science and teaching

Every programming language has two sides you need to keep separate. Syntax is the grammar of the language: the exact spelling, punctuation and arrangement the translator accepts. Semantics is the meaning: what the arranged symbols actually tell the computer to do.

A syntax error announces itself immediately because the translator refuses to run the code. A semantic error is subtler: the program runs quietly and obeys what you wrote rather than what you meant. Learning to tell grammar apart from meaning saves hours of chasing the wrong problem.

Languages also group into programming paradigms—distinct styles for structuring computation:

  • Procedural / structured (C, Pascal): organises work into ordered sequences, selection (if), loops and reusable procedures operating on passed data.
  • Object-oriented (Java, C++, Python): models a system as interacting objects that bundle state (attributes) with behaviour (methods).
  • Functional (Haskell, Lisp, and Python's map/filter/lambda): computes by composing pure functions without mutating shared state.
  • Declarative and logic (SQL for declarative queries; Prolog for logic rules and facts): state what result or relationship holds rather than spelling out step-by-step control flow.
  • Scripting and event-driven (Python, JavaScript, GUI frameworks): automate glue tasks rapidly, or structure execution around an event loop that invokes handler methods whenever a click, keypress or network message arrives. Modern languages such as Python, Java and C++ are multi-paradigm, letting you combine structured control flow, functional transforms, object-oriented classes and event handlers inside one project.

The Craft of Coding

Programming is the craft of transforming requirements into something a computer can execute. It means breaking down a solution into precise step-by-step commands, writing them in a programming language the computer understands, and turning human ideas into machine-executable code.

Computer programming, often shortened to coding, is the process of writing, testing, debugging and maintaining source code for solving a problem with the computer. Source code is written in an accepted language such as C++, Java or Python. Its goal is customisation: making the machine show the exact behaviour described in the requirements, nothing more and nothing less.

Four core activities make up that craft:

  • Writing: turning designed steps into source code.
  • Testing: running the code on known cases to check for wrong behaviour.
  • Debugging: tracking down an exposed fault to the exact line causing it and fixing it.
  • Maintaining: keeping working code reliable as requirements shift, machines change, and years pass. Most professional effort goes here, because successful software often outlives its author's memory of writing it.

Machines take instructions literally, so vague wishes must be turned into exact requirements before coding starts. "Handle my stock" could mean count it, reorder it, or price it; the computer cannot guess. "Sort the students" leaves just as much open: by surname or matric number, ascending or descending, and how should ties be broken?

A programmer's first job is to pin down inputs, rules and outputs until only one reading remains.

Three Kinds of Programming Faults
Fault TypeWhat HappensExample
Syntax faultBreaks language grammar; the translator refuses to run the programMissing punctuation or a misspelled keyword
Runtime faultGrammar is valid, so the program starts, then crashes mid-runDividing by zero or opening a missing file
Logic faultRuns to completion without crashing, but produces the wrong answerTesting "below 50" when the rule requires "above 50"

Logic faults are the hardest to catch because no translator warns you about them. The only way to expose them is deliberate testing. Choose your test data before running the program:

  • Normal cases: e.g. 45, 60, 55, 70 (average 57.5, expects Pass).
  • Boundary cases: e.g. 50, 50, 50, 50 (average exactly 50, expects Pass).
  • Invalid cases: e.g. -5 or 999 (should be rejected or handled safely).

Predict each output by hand first, then run the code and compare. When your prediction and the output disagree, check both the code and your arithmetic. Untested code is never finished code.

Finally, write code that is easy to read, because code is read far more often than it is written. Use meaningful names (totalScore rather than ts), keep one clear idea per line, format consistently, and add comments that explain why a choice was made rather than what the code does. The person reading your code six months from now is usually you—make their job easy, and trim out any needless complexity that adds confusion without value.

Requirements human wishes Source code C++, Java, Python Behaviour the machine obeys test and debug at every arrow
Wishes become code, code becomes behaviour, and testing guards every step.

Pause & think

A trader says, "I want the computer to handle my stock." Is that a program, a requirement, or source code?

Programming converts loose wishes into exact instructions that make machines behave as described.

📌 If you remember nothing else…

  • A program is a set of instructions telling a computer what to do.
  • A programmer designs, creates, tests and maintains programs across many industries.
  • Coding covers writing, testing, debugging and maintaining source code.
  • Separating syntax from semantics, and testing normal, boundary and invalid cases, keeps faults out of finished programs.

Quick check

Did it land?

1. What is a program?
2. Which four activities make up coding?

Spotted a mistake?