Skip to content
Belajar C++

What Is Programming?

20 minutes Beginner

Learning Objectives

  • Understand what programming is and how it works at a basic level
  • Learn what a compiler does and why it's needed
  • Know why C++ is a great language to learn

What Is Programming?

Have you ever wondered how a video game knows when your character should jump? Or how Instagram displays your friend’s photos in your feed? All of this happens because someone wrote a program — a set of instructions that tells a computer what to do.

Programming = Giving Instructions

Imagine you want to teach someone how to make a peanut butter sandwich. You’d write step-by-step instructions:

  1. Take two slices of bread
  2. Open the peanut butter jar
  3. Use a knife to spread peanut butter on one slice
  4. Put the other slice on top
  5. Done — enjoy your sandwich!

Programming is exactly like that — except the instructions are written for a computer, not a human. The difference is that computers are extremely literal. If you say “spread,” the computer doesn’t know what that means unless you explain precisely how to do it — how much, in which direction, how fast.

Programming is the process of writing these instructions in a language the computer can understand. These instructions are called code or source code, and the people who write them are called programmers or developers.

Programming Languages

Computers only truly understand one language: binary — sequences of 0s and 1s. Writing programs in binary is miserable (imagine writing an essay in Morse code!), so humans invented programming languages that are easier for us to work with.

There are many programming languages out there:

  • Python — popular for data science and AI
  • JavaScript — the main language for websites
  • Java — widely used in Android apps and enterprise software
  • C++ — the one we’ll be learning! Used for games, operating systems, and competitive programming

Each language has its strengths. There’s no single “best” language — only the language that’s most suited for a given task.

What Is a Compiler?

We said computers only understand binary (0s and 1s). But the C++ code we write uses English words and letters. So how does the computer understand it?

This is where the compiler comes in. A compiler is a program that translates the code we write (called source code) into machine language (binary) that the computer can execute.

Think of it this way: imagine you write a letter in English, but the recipient only understands Japanese. You need a translator to convert your letter into Japanese. The compiler is that translator — it reads your C++ code and converts it into instructions that your computer’s processor understands.

Here’s the workflow:

Source Code (.cpp)  →  Compiler  →  Program (.exe)  →  Computer runs it
   (you write)        (translates)   (translated result)  (output on screen)

C++ compilation flow: Source Code → Compiler → Program → Output on screen

One cool thing about compilers: they also tell you when there are mistakes (errors) in your code. So a compiler isn’t just a translator — it’s also a “spell checker” for your programs.

Why Learn C++?

Among all the programming languages out there, why choose C++? Here are some reasons:

1. C++ is fast — really fast

C++ is one of the fastest languages available. AAA games using Unreal Engine are written in C++. Operating systems like Windows and Linux are built with C/C++. When performance matters, C++ is often the go-to choice.

2. C++ teaches strong fundamentals

Learning C++ is like learning to drive a manual car before switching to automatic. You’ll understand how computers work at a deeper level — memory, processors, data types. This knowledge makes you better at any programming language later on.

3. Competitive programming

If you’re interested in programming competitions (IOI, ICPC, Codeforces, AtCoder), C++ is the most commonly used language by contestants. Its high speed and comprehensive standard library make it ideal for solving algorithmic problems.

4. Wide career opportunities

C++ developers are needed in game development, robotics, embedded systems, fintech (trading systems), and more. The skills are transferable to other languages because the fundamentals are solid.

C++ is used in game engines (Unreal Engine), operating systems (Windows, Linux), browsers (Chrome, Firefox), and programming competitions worldwide!

A Brief History of C++

C++ was created by Bjarne Stroustrup in 1979 at Bell Labs. It was originally called “C with Classes” because it was an extension of the existing C language. The name “C++” itself is a programmer joke — in C, ++ means “increment by 1,” so C++ means “C plus one” or an improved version of C.

From the start, C++ was designed to give programmers full control over hardware while also providing high-level abstraction features. It continues to evolve today — the latest version (C++23) keeps adding modern features.

What Will We Learn?

In this course, you’ll learn:

  • How to write C++ programs from scratch
  • Variables, data types, and basic operations
  • Branching (if/else) and loops
  • Functions — how to break programs into smaller pieces
  • Arrays and strings — storing multiple data items
  • And much more!

Each unit ends with a project that applies everything you’ve learned. So you won’t just read theory — you’ll actually build programs that run.

You don’t need to be great at math to learn programming. All you need is curiosity and patience. Every skilled programmer was once confused and frustrated at the start — that’s completely normal!

What Does a Compiler Do?

Which of the following best describes the role of a compiler in C++ development?

C++ Name Origin

The name 'C++' is a programmer joke. In C, the `++` operator means 'increment by 1'. What does the name C++ imply about the language?

Summary

  • Programming is the process of writing instructions for a computer
  • Programming languages make instructions easier for humans to write
  • A compiler translates source code into machine language
  • C++ is a fast, powerful language that builds strong fundamentals
  • You don’t need any special background to start — just curiosity!

In the next lesson, we’ll set up our learning environment — getting everything ready so you can start writing and running your first C++ code.