No history yet

Introduction to Programming

What is Programming?

At its core, programming is simply telling a computer what to do. Think of it like writing a very precise recipe. If you want to bake a cake, you need a list of ingredients and a set of step-by-step instructions. A computer program is similar: it's a set of instructions that a computer follows to accomplish a specific task.

These instructions can be simple, like adding two numbers together, or incredibly complex, like powering a social media app or guiding a spacecraft. The person who writes these instructions is called a programmer.

Programming

noun

The process of creating a set of instructions that tell a computer how to perform a task.

The collection of instructions itself is often guided by an overall plan or logic, known as an algorithm.

Algorithm

noun

A step-by-step procedure or formula for solving a problem or accomplishing a task.

The Language of Computers

You can't write instructions for a computer in English or Spanish. Computers operate on a very basic level, understanding only electronic signals. To bridge this gap, we use programming languages.

A programming language is a special, structured language that both humans can write and computers can understand (after a translation step). There isn't just one language; there are thousands. Each is designed for different purposes, much like a carpenter has different saws for cutting different materials.

Lesson image

Some languages, like Python, are known for being easy to learn. Others, like C++, are used for high-performance applications like video games. The specific language isn't as important for a beginner as understanding the fundamental concepts they all share.

The Basic Structure of a Program

No matter the language or the task, almost every program follows a fundamental structure: it takes some information in, does something with it, and then produces a result.

This is often called the Input-Process-Output (IPO) model.

Here’s what each part means:

  • Input: This is the data or information the program needs to work. It could be text you type, a file you open, or a click from a mouse.
  • Process: This is the 'thinking' part. The program takes the input and performs actions based on its instructions, like calculations, comparisons, or data manipulation.
  • Output: This is the result of the processing. It might be text displayed on the screen, a new file being saved, or a sound playing from the speakers.

Let’s look at a simple example. Imagine a program that calculates your age. The input would be your birth year. The process would be subtracting your birth year from the current year. The output would be the result of that subtraction, your age, displayed on the screen.

We've covered the what and why of programming. Now let's test your understanding.

Quiz Questions 1/4

At its most fundamental level, what is a computer program?

Quiz Questions 2/4

Why are special programming languages necessary to write computer programs?