Introduction to Coding
Introduction to Programming
What Is Programming?
At its heart, computer programming is simply the act of giving a computer a set of instructions to follow. Think of it like writing a recipe. A recipe lists ingredients and provides step-by-step directions to turn those ingredients into a meal. A computer program lists data and provides step-by-step instructions to turn that data into a useful result.
These instructions, collectively called code, allow us to create software, build websites, analyze data, and power the technology we use every day. Programmers write code to solve problems, from calculating a restaurant bill to guiding a spacecraft to another planet.
A World of Languages
Just as humans speak many different languages, there are thousands of programming languages. Each has its own strengths and is suited for different tasks. You don't need to know all of them. Most programmers specialize in just a few.
| Language | Commonly Used For |
|---|---|
| Python | Data science, web development, automation |
| JavaScript | Websites, web applications, mobile apps |
| C++ | Video games, operating systems, high-performance software |
| Swift | Apps for Apple devices (iPhone, iPad, Mac) |
Some languages, like Python, are called high-level languages. They are designed to be easier for humans to read and write. Others, known as low-level languages, are closer to the ones and zeros that a computer's processor actually understands. They give a programmer more control but are often harder to work with.
The Anatomy of a Program
Most programs follow a basic pattern: they take some input, perform some actions on it, and then produce an output. A calculator app, for instance, takes numbers as input, performs addition, and shows the result as output.
To make this happen, we write source code. This is the human-readable text that makes up a program. Here’s a classic first program written in Python. It's a tradition for new programmers to start with a program that just prints the phrase "Hello, World!" to the screen.
# This is a comment. The computer ignores it.
# It's here to explain the code to humans.
print("Hello, World!")
This simple line of code is a complete program. It uses a built-in function called print() to display the text inside the parentheses. For the computer to understand this instruction, it must be written perfectly, which brings us to two crucial concepts: syntax and semantics.
syntax
noun
The set of rules that defines the correct structure of symbols and keywords in a programming language.
Syntax is like grammar. In English, we know that "The cat sat" is a grammatically correct sentence. If we wrote "Cat the sat," the grammar would be wrong, and the meaning would be lost. Programming languages are extremely strict about their syntax. A misplaced comma or a forgotten quote can prevent the entire program from running.
semantics
noun
The meaning of a syntactically valid piece of code; what the program is supposed to do.
Semantics is about logic and meaning. The English sentence "The dog meowed loudly" is grammatically perfect (good syntax), but it doesn't make sense (bad semantics) because dogs don't meow. In programming, a semantic error means your code runs, but it doesn't do what you intended it to do. For example, you might have told the computer to subtract two numbers when you meant to add them.
Syntax is the grammar. Semantics is the meaning. A program needs both to be correct.
Understanding these core ideas is the first step on your programming journey. Every program you'll ever write, no matter how complex, is built from these fundamental principles of giving clear, structured instructions to a computer.
At its most fundamental level, computer programming is the act of:
A programming language like Python, which is designed to be easier for humans to read and write, is considered a:


