1

Introduction to Programming

At its core, programming is simply the act of writing a strict set of instructions for a machine. Computers are infinitely fast, but they are infinitely stupid. They do exactly what you tell them to do—no more, no less. They cannot guess your intentions.

Imagine writing directions for a robot to make a cup of coffee. You can't say "make coffee." You have to say: "Walk to the kitchen. Open the cabinet. Take one mug. Place it on the counter. Open the coffee jar..." and so on, step by step. That is programming.

The "Blame" Rule

When a program crashes, who is to blame? Always the person who wrote the code. Even when AI (ChatGPT, GitHub Copilot) writes code for you—if the code fails, it is your fault as the prompter. You must verify the logic. The computer never makes mistakes; it only exposes ours.

Visualizing Logic: Flowcharts

Before writing code, programmers plan the logic using flowcharts. Each shape represents a different type of instruction:

Oval
Start / EndWhere the program begins and terminates.
Rect
Process / ActionDoing math or executing a command.
DecisionAsking a Yes/No question to branch logic.
Input / OutputReading user data or printing to screen.

Here is a classic real-world scenario: "Should I bring an umbrella?"

Start Is it raining? Yes Take Umbrella No End