Appearance
We'll start from Lesson 1, because if this foundation is strong, everything else becomes much easier.
Lesson 1: What is Programming?
Before TypeScript, before JavaScript, before coding...
Let's first understand what programming actually is.
Imagine this situation
You have a robot 🤖.
The robot is very powerful.
But there is one problem...
It doesn't think.
It only follows instructions exactly as they are given.
If you tell it:
Go forward.
It goes forward.
If you don't tell it to stop...
It keeps going forever.
Another Example
Suppose you tell your younger brother:
- Go to the kitchen.
- Open the fridge.
- Take the milk.
- Pour it into a glass.
- Bring the glass to me.
These are instructions.
Your brother is following your instructions step by step.
Programming works exactly like this.
Definition
Programming is the process of giving instructions to a computer so it can perform tasks.
A computer cannot guess what you want.
You have to tell it every step.
What is a Program?
A program is simply a collection of instructions.
Example:
1. Ask user for two numbers.
2. Add them.
3. Show the answer.This is already a program!
Real Life Examples
Calculator
Instructions:
Input first number
Input second number
Add them
Display resultAlarm App
Instructions:
Check current time
Compare with alarm time
If equal
Play alarm soundInstagram
Instructions:
User logs in
Load profile
Load posts
Show posts
If user likes photo
Increase like countMillions of instructions work together.
Then what is Coding?
Programming and Coding are related but not exactly the same.
Think like this:
Programming = Planning + Writing Instructions
Coding = Writing those instructions in a programming language.
Example:
English instruction:
Add two numbers.TypeScript code:
ts
let a = 10;
let b = 20;
console.log(a + b);This is called coding.
Why can't computers understand English?
Computers understand only machine language, which is made of 0s and 1s.
Example:
101101001011010Humans can't easily write millions of instructions like this.
So programmers use languages like:
- TypeScript
- JavaScript
- Python
- Java
- C++
- Go
These are much easier for humans to read and write.
Later, tools convert them into instructions the computer can execute.
Real-life Analogy
Imagine you're at a restaurant.
- You = Customer
- Waiter = Programming Language
- Chef = Computer
You don't go into the kitchen and tell the chef exactly what to do.
You tell the waiter your order.
The waiter translates your request into something the chef can act on.
Similarly, you write code in TypeScript, and the TypeScript compiler plus JavaScript engine help turn it into instructions the computer can execute.
What does a programmer actually do?
A programmer solves problems.
Examples:
- Build websites
- Build mobile apps
- Make games
- Create AI
- Build banking software
- Control robots
- Analyze data
- Automate repetitive tasks
Programming is really problem-solving using code.
Key Points
- A computer cannot think or guess.
- It follows instructions exactly.
- A set of instructions is called a program.
- Writing those instructions is called programming.
- Writing them in a programming language is called coding.
- TypeScript is one programming language we'll use to write those instructions.
Quick Quiz
Try answering these without looking back:
- What is programming?
- What is a program?
- Why can't computers understand English directly?
- What is the difference between programming and coding?
- Why do we use languages like TypeScript instead of writing 0s and 1s?