A program is a set of instructions that tells your computer what to do
A computer program is a list of commands written in a language the computer understands. When you run a program, the computer reads those commands one by one and carries them out. Every process on your device — your web browser, email client, word processor, or game — is a program. The program tells the computer which keys to listen for, what to display on screen, where to store information, and when to perform calculations.
Programs are written by people called programmers or developers using programming languages like Python, Java, C++, or JavaScript. These languages let developers write instructions in a way that is closer to human language than the raw 1s and 0s the computer's processor actually uses. A tool called a compiler or interpreter then translates those human-readable instructions into machine code — the binary language the processor can execute.
The program sits on your hard drive or solid-state drive as a file until you open it. Once you click the icon or type the command to launch it, the operating system loads the program into your computer's memory (RAM) and the processor begins executing its instructions. The program stays running until you close it or it finishes its task.
Key Takeaways
- A program is a sequence of instructions written in a programming language that tells your computer how to perform specific tasks.
- Programmers write code in languages like Python or Java, which are then translated into machine code the processor can execute.
- When you open an process, the operating system loads the program into memory and the processor runs its instructions line by line.
- Programs can range from straightforward utilities that perform one task to complex applications like video editors or operating systems themselves.
- The source code (the original instructions) and the compiled program (the executable file) are two different forms of the same program.
How programs are built and what they contain
Every program starts with source code — the actual text that a programmer writes. Source code is human-readable and organized into sections called functions or methods, each of which performs a specific task. For example, a function might calculate the total price of items in a shopping cart, or it might check whether a password is strong enough.
Programmers also write comments in the source code — notes to themselves and other developers explaining what each section does. These comments are ignored when the program runs; they exist only to make the code easier to understand and maintain.
Once the source code is written, it must be converted into a form the computer can actually run. This conversion happens in two main ways. Some languages use a compiler, which reads the entire source code at once and produces an executable file — a standalone program you can run without the original code. Other languages use an interpreter, which reads and executes the code line by line each time the program runs. Compiled programs usually run faster, while interpreted programs are often easier to test and modify.
The difference between programs and files
A program is a specific type of file — one that contains executable instructions. Not all files are programs. A text document, a photograph, or a spreadsheet are files, but they are not programs because they do not contain instructions for the computer to follow. Instead, they contain data — information that a program reads and displays or modifies.
When you open a Word document, you are not running the document itself. You are running the Microsoft Word program, which reads the document file and displays its contents on screen. The program handles all the logic: it knows how to format text, save changes, and respond to your clicks. The document is just data that the program works with.
This distinction matters because it explains why you need the right program to open a file. A .jpg image file cannot run as a program; it needs an image viewer program to display it. A .mp3 audio file needs a media player program. The program is the engine; the file is the fuel.
Types of programs and what they do
Operating system programs like Windows, macOS, or Linux manage your entire computer. They control how hardware works, run other programs, and let you interact with your device through a keyboard, mouse, or touchscreen.
process programs are what most people think of as "programs." These include web browsers (Chrome, Firefox, Safari), productivity software (Microsoft Office, Google Docs), media players, games, and messaging apps. Each one is designed to do a specific job or set of jobs.
Utility programs perform maintenance or system tasks. Antivirus software, disk cleaners, and file managers are utilities. They run in the background or on demand to keep your computer running smoothly.
System programs support the operating system and other applications. Device drivers are system programs that let your operating system communicate with hardware like printers, graphics cards, or network adapters. Without the right driver program, your computer cannot use the hardware correctly.
How programs communicate with your hardware
A program cannot directly touch your computer's physical components. Instead, it sends requests to the operating system, which acts as a middleman. When you click a button in a program, the program tells the operating system "the user clicked here." The operating system then figures out what to do based on the program's instructions.
Similarly, when a program needs to save a file, it does not write directly to your hard drive. It asks the operating system to write the data, and the operating system handles the actual storage. This separation protects your hardware and prevents programs from interfering with each other.
Programs also use process programming interfaces (APIs) — sets of rules that let different programs talk to each other. For example, a weather app might use an API provided by a weather service to fetch current conditions. The app sends a request through the API, and the weather service sends back the data the app needs to display.
Why programs need updates
Programs are updated for three main reasons: to fix bugs, to add new features, and to patch security vulnerabilities. A bug is a mistake in the code that causes the program to behave unexpectedly — it might crash, display incorrect information, or fail to complete a task.
Developers discover bugs through testing and through reports from users who encounter problems. When a bug is found, programmers locate the faulty code, fix it, and release an updated version of the program. This is why you see update notifications on your phone or computer; the developer has released a new version with bug fixes or improvements.
Security updates are especially important. If a programmer discovers a weakness in the code that a hacker could exploit, they release a patch to close that hole. Running outdated programs leaves your computer and data vulnerable to attack.
Open-source versus proprietary programs
Proprietary programs are owned by a company or individual. You can run them, but you cannot see or modify the source code. Microsoft Word, Adobe Photoshop, and most commercial software fall into this category. The company keeps the source code secret to protect their intellectual property and business model.
Open-source programs make their source code publicly available. Anyone can read it, modify it, and redistribute it — usually under a license that requires them to share their changes. Linux, Firefox, and LibreOffice are open-source. Open-source programs are often free, and the community of developers can spot and fix problems quickly because many people can see the code.
Neither type is inherently better. Proprietary software often has dedicated support and polished interfaces. Open-source software is often more transparent and flexible, but may require more technical knowledge to use or modify.
How programs use memory and storage
When a program runs, it uses two types of storage: RAM (random-access memory) and your hard drive or solid-state drive. RAM is fast but temporary — it holds the program's instructions and data while the program is running. When you close the program or shut down your computer, everything in RAM is erased.
Your hard drive or SSD is permanent storage. The program file itself lives there, along with any files you save. When you launch a program, the operating system copies it from the drive into RAM so the processor can execute it. If a program uses a lot of RAM, your computer may slow down because the operating system has to manage limited memory across multiple running programs.
Large programs like video editors or 3D modeling software require significant RAM and storage space. Smaller programs like calculators or note-taking apps use very little. Checking a program's system requirements before installing it tells you whether your computer has enough resources to run it smoothly.
Frequently Asked Questions
Is an app the same thing as a program?
Yes. "App" is short for process, which is a type of program. The term "app" became popular with smartphones and tablets, but technically any program that performs a specific task — whether on a phone, tablet, or desktop computer — can be called an app or an process.
Can I write my own program?
Yes. You can learn a programming language like Python, JavaScript, or C++ and write code to create your own programs. Many free resources, tutorials, and communities exist to help beginners learn. Start with a language designed for learning, like Python, which has a simpler syntax than many others.
What happens if a program crashes?
A crash occurs when a program encounters an error it cannot recover from. The program stops responding and closes. This might happen because of a bug, a conflict with another program, or insufficient memory. Restarting the program usually fixes the problem. If crashes happen repeatedly, updating the program or checking your computer's available storage and RAM may help.
Do I need to install every program I want to use?
Not always. Some programs are web-based, meaning they run in your browser without installation — Google Docs and Gmail are examples. Others must be installed on your computer before you can run them. Installation copies the program files to your hard drive and sets up any necessary configurations. Portable programs can run from a USB drive without installation.
Why do programs take up so much storage space?
Modern programs often include graphics, sounds, fonts, and libraries of code that other programs can use. A straightforward text editor might be a few megabytes, while a video editor or game can be several gigabytes. Larger programs also include more features and higher-quality assets, which require more storage space.