What is Coding?
Discover what coding is, why millions of people are learning it, and write your very first line of code.
Welcome to your coding journey! In this first lesson, you'll discover what coding actually is and why it's one of the most valuable skills you can learn today.
What is Coding?
Coding (also called programming) is simply writing instructions for a computer to follow. Think of it like writing a recipe—you're telling the computer exactly what steps to take, in what order, to achieve a specific result.
Just like a recipe might say "add 2 cups of flour, then mix for 3 minutes," code tells a computer things like "show this text on the screen" or "add these two numbers together."
Key Insight
Computers are very literal—they do exactly what you tell them, nothing more, nothing less. If your instructions have a mistake, the computer won't "figure out what you meant." This is why precision matters in coding!
Why Learn to Code?
Learning to code opens up incredible opportunities:
- Build things: Create websites, apps, games, and tools that millions can use
- Problem-solving: Develop logical thinking skills useful in any career
- Career opportunities: Programming jobs are in high demand and well-paid
- Automation: Make computers do repetitive tasks for you
- Understanding technology: Know how the digital world actually works
What is a Programming Language?
Computers don't understand English (or any human language). They only understand binary—sequences of 0s and 1s. But writing in binary would be incredibly tedious!
Programming languages bridge this gap. They're special languages with specific rules that are easier for humans to write and read, but can be translated into instructions computers understand.
Some popular programming languages include:
- JavaScript: Powers interactive websites (what we'll use in examples)
- Python: Great for beginners, data science, and AI
- HTML/CSS: Structure and style web pages
- Java: Used in Android apps and enterprise software
- C++: Used in games and performance-critical applications
Try It Yourself: Your First Code
Let's write your very first program! The code below uses JavaScript to display messages. Click the Run button to see it work, then try changing the messages!
Congratulations! 🎉 If you clicked Run, you just executed your first program.
The console.log() function tells the computer to display whatever message
is inside the parentheses.
Breaking Down the Code
Let's understand what each part does:
-
//— This creates a comment. Comments are notes for humans; the computer ignores them completely. -
console.log()— This is a function that displays output. We'll learn more about functions later! -
"Hello, World!"— The text inside quotes is called a string. It's the actual message being displayed. -
;— The semicolon marks the end of an instruction (like a period in a sentence).
Common Mistakes Beginners Make
Don't worry if you make these—everyone does at first!
- Forgetting quotes: Text must be in quotes:
"like this" - Typos in function names:
console.lognotconsol.log - Mismatched parentheses: Every
(needs a) - Case sensitivity:
console.logis different fromConsole.Log
Quick Quiz
Test your understanding of what we've covered:
Key Takeaways
- Coding is writing instructions for computers to follow
- Programming languages make it easier to communicate with computers
- Computers are literal—they do exactly what you tell them
console.log()displays messages in JavaScript- Making mistakes is normal and part of learning!
What's Next?
Now that you know what coding is, it's time to learn about variables—how programs store and remember information. This is where things start getting really interesting!
Finished this concept?
Mark it complete to track your progress