Introduction to Programming
Understanding Computers, Programming, and Software Development
Programming is the process of creating instructions that allow a computer to perform tasks. To understand programming clearly, it helps to begin with what makes computers different from many other machines, then examine programs, programming languages, software design, and the programmer’s workflow.
Computers as Flexible Machines
Many machines are designed for one primary purpose. A traditional car engine converts fuel into mechanical motion that turns the wheels. A basic sewing machine moves a needle and advances fabric according to its settings. After those machines are built and configured, their basic functions are largely fixed.
A computer is different because it is a general-purpose machine. Its purpose is not limited to one physical task. Instead, it can perform many different tasks depending on the instructions it receives.
For example, the same computer might:
- Browse the internet.
- Play or stream a video.
- Run a word processor.
- Store and organize files.
- Play a video game.
- Run a business application.
- Communicate with other computers.
When a computer streams a video, it performs several coordinated activities. It requests the video, receives data packets, processes the data, displays images on the screen, and produces audio through speakers or headphones. The computer can later stop streaming and begin performing an entirely different task because its behavior is controlled by software rather than being permanently fixed into its physical design.
Smartphones, laptops, desktops, and many modern devices are all computers. Computers are also built into devices that may appear to have only one purpose, such as cars, sewing machines, and pipe organs. A manufacturer may place a computer inside such a device because programming a computer can be simpler and more flexible than designing a complicated collection of electronic or mechanical controls.
The important idea is that a computer’s functionality can be changed by providing different instructions. New software can give the same physical machine new abilities.
A computer is a flexible machine whose behavior can be changed by giving it different sets of instructions.
Think About It
Why might a manufacturer use a computer to control a device with only one main purpose instead of building a completely specialized control system?
Programming, Programs, and Software
Programming is the act of creating instructions that enable a computer to perform a task or gain new functionality. A person who writes those instructions is called a programmer.
A program is a set of instructions that a computer can follow. When a computer runs a program, it carries out those instructions in order to accomplish a task.
Examples of programs include:
- Web browsers such as Firefox or Chrome.
- Mobile applications such as a learning-management app.
- File-management programs such as File Explorer.
- Video games.
- Operating systems such as Windows, iOS, or Android.
The term software is broader than the term program. Software generally refers to programs and related instructions that operate on a computer. A small application may be called a program, while a large collection of programs, tools, and services may be described as software.
An operating system is also software. It provides the basic instructions that allow users and other programs to interact with the computer. It helps manage the computer’s resources and provides the environment in which applications run.
For example, a web browser depends on the operating system to access the screen, keyboard, files, network connection, and other hardware. The operating system acts as an important layer between applications and the physical computer.
User Interaction
Many programs are designed to respond to user interaction. User interaction occurs when a person provides input to a program, such as:
- Typing information into a form.
- Clicking a button.
- Selecting an option.
- Tapping an icon.
- Moving a mouse.
- Entering information through a keyboard or another input device.
Consider an online appointment form. A user types personal information, selects a date, and clicks a submission button. The web browser receives this input and passes the information to a web server when the form is submitted. The server can then process the information and respond.
This process may involve many technical steps, but the central programming idea is straightforward: the program receives input, decides what to do with that input, and produces an appropriate result.
Programs created in Visual Basic will rely heavily on user interaction. The program will respond to actions such as button clicks, typed information, and selections made through a graphical interface.
Think About It
What inputs might a program need to collect before it can schedule a medical appointment or calculate the total cost of an order?
How Computers Represent Instructions
At the physical level, computers use electrical signals. These signals can be treated as being in one of two basic states: on or off. These two states are represented using binary digits, often called bits.
Binary uses combinations of the values 0 and 1 to represent information. By assembling many binary digits into patterns, a computer can represent numbers, text, images, sounds, and instructions.
A computer does not understand instructions in the same way a human does. It processes electrical states according to the patterns and rules built into its hardware. Therefore, a program must eventually be converted into a form that the computer’s processor can execute directly.
This creates a communication problem. Humans prefer meaningful words and recognizable structures, while computer hardware ultimately operates using binary instructions.
Binary and Assembly Language
Early programming required working very close to the computer’s hardware. In principle, instructions could be written directly as binary patterns. Each sequence of binary digits would represent a specific operation for the processor.
Advantages of Low-Level Instructions
Writing instructions close to the hardware can provide precise control. A programmer who specifies individual machine instructions knows exactly which actions the computer is being told to perform.
This precision can make it possible to:
- Control hardware very directly.
- Optimize a program for speed.
- Reduce unnecessary operations.
- Make the computer perform a highly specific sequence of actions.
For specialized situations, this level of control can still be valuable. Some programmers continue to use assembly language when a program requires very specific optimization or hardware-level behavior.
Problems with Binary Programming
Programming directly in binary is extremely difficult and time-consuming. Even a relatively simple task may require a large number of individual instructions.
For example, a program with a window, images, and clickable buttons would need instructions for many separate activities:
- Displaying the window.
- Drawing the images.
- Detecting mouse activity.
- Determining where the mouse was clicked.
- Deciding whether the click occurred on a meaningful control.
- Responding appropriately to the click.
- Updating what appears on the screen.
Writing each of these actions directly in binary would require a large amount of code. The binary instructions would also be difficult for a human to read, remember, organize, and debug. Small mistakes could be hard to locate because the individual instructions provide little obvious meaning.
Assembly language improved this situation by replacing raw binary patterns with short, more recognizable textual commands. An assembly program can then be translated into binary instructions. Assembly is more readable than binary, but it still requires detailed knowledge of the computer’s hardware and often requires many instructions to perform tasks that are simple at a higher level.
Programming Languages
A programming language is a structured language that allows humans to write instructions in a more readable and manageable form. Programming languages do not make programming identical to writing ordinary sentences, but they use recognizable words, symbols, and rules that are easier for people to learn than binary patterns.
A programming language can combine many low-level instructions into a smaller number of higher-level commands. Instead of manually writing every operation needed to make a button work, a programmer can use language features and libraries designed for buttons and user interfaces.
Programming languages make it easier to:
- Express ideas in a form closer to human reasoning.
- Remember common instructions.
- Organize large programs.
- Reuse existing functionality.
- Detect mistakes.
- Build complex applications more efficiently.
Examples of programming languages include C, C++, Java, JavaScript, Python, and Visual Basic. These languages differ in syntax, features, and typical uses, but they all provide a way for humans to describe computational instructions.
A programming language does not eliminate the need for precise thinking. The computer still requires instructions to follow exact rules. The advantage is that the programmer can work at a higher level of abstraction instead of manually specifying every electrical-level operation.
Translation into Machine Instructions
Instructions written in a programming language must eventually be translated into binary instructions that the computer can execute. Two important approaches are compilation and interpretation.
A compiler translates source code into an executable form before the program runs. The resulting executable program can then be run by the computer. Visual Basic uses compilation as part of the process of creating an executable application.
An interpreter reads and processes program instructions while the program is running. Instead of translating the entire program into an executable form ahead of time, the interpreter works with the instructions during execution.
The details differ between languages and systems, but both approaches serve the same general purpose: they connect human-readable programming instructions with the binary instructions processed by the computer.
The overall process can be summarized as follows:
- A programmer writes instructions in a programming language.
- A compiler or interpreter translates those instructions.
- The computer receives instructions in a form its hardware can execute.
- The computer performs the requested task.
Programming languages act as a bridge between human problem-solving and machine-executable instructions.
Think About It
Why is a human-readable programming language especially important when a program contains thousands or millions of instructions?
Programming Language Paradigms
A programming paradigm is a general style or way of thinking about how programs should be designed. A paradigm influences how programmers organize instructions, data, and relationships within a program.
One important paradigm is object-oriented programming, often abbreviated as OOP.
Object-Oriented Programming
Object-oriented programming organizes a program around objects. An object represents something that can be used within the program. It may represent a visible item, such as a button or window, or a less visible concept, such as a student, teacher, assignment, or class record.
An object has:
- Properties, which describe information about the object.
- Behaviors or procedures, which describe what the object can do.
- Interactions, which describe how the object communicates with other objects.
For example, a button object might have properties such as its name, position, size, color, and displayed text. It might also be able to respond when a user clicks it. An application object could place the button on a window, while the button could notify the application that it has been clicked.
This way of thinking differs from simply listing every instruction in one long sequence. Instead of viewing the program only as “first do this, then do that,” object-oriented programming focuses on which objects exist, what each object knows, what each object can do, and how the objects work together.
Properties
A property is a characteristic or piece of information associated with an object.
For example, a teacher object might have:
- A name.
- An employee identifier.
- A list of courses being taught.
A student object might have:
- A name.
- A student identifier.
- A list of courses being taken.
An assignment object might have:
- A name.
- A point value.
- A relationship to a particular course.
Properties allow a program to store information about an object and refer to that information when needed.
Behaviors and Procedures
Objects can also perform actions. These actions may be called behaviors, methods, or procedures, depending on the programming language and context.
A teacher object might be able to:
- Teach a course.
- Prepare lecture materials.
- Deliver a lecture.
- Grade an assignment.
Grading an assignment would require the teacher object to work with other objects, including a course object, an assignment object, and student-submission information. The teacher object could use the relevant properties and procedures to determine grades.
Some procedures may be available to other objects, while others may be restricted so that only the object itself can use them. This allows a class to control how its objects are used and protects internal operations from inappropriate access.
Classes and Objects
A class is a pattern or blueprint used to create objects. The class describes what objects of that type will contain and what they will be able to do.
For example, a Teacher class might specify that every teacher object has:
- A name.
- An employee identifier.
- A list of courses.
- The ability to teach.
- The ability to grade assignments.
A Student class might specify that every student object has a name and a list of courses. An Assignment class might specify information and actions related to assignments.
The class itself is not necessarily one specific teacher or student. It is the design that explains how such objects should be created.
An object created from a class is called an instance of that class. When a program creates an object from a class, the program is said to instantiate the object.
The relationship can be understood through a blueprint analogy:
- The class is the blueprint for a house.
- An object is one actual house built from that blueprint.
- Multiple houses can be created from the same blueprint.
- Each house follows the same general design but can have different values, such as an address or paint color.
Similarly, multiple teacher objects can be created from the same Teacher class. Each teacher has the properties and behaviors defined by the class, but each teacher object contains different information.
An Object-Oriented Course Example
A course-management system could contain several interacting objects:
- A teacher object representing the instructor.
- A course object representing a particular course section.
- Student objects representing enrolled students.
- Assignment objects representing homework and quizzes.
The course object might contain:
- The course name or number.
- A list of students.
- A list of assignments.
- A teacher property.
The teacher object might contain a list of courses being taught. This creates a relationship in both directions: the teacher refers to the course, and the course refers to the teacher.
When the teacher grades an assignment, several objects interact. The teacher finds the appropriate course, locates the relevant assignment, examines student submissions, and assigns point values. Students interact with the course object by viewing assignments and submitting work.
This example illustrates the central object-oriented idea:
A program can be understood as a collection of objects that store information, perform actions, and interact with one another.
Think About It
In a course-management program, which properties would belong to a student object, and which properties would belong to an assignment object?
Integrated Development Environments
An integrated development environment, or IDE, is a program that provides tools for creating other programs.
Before modern IDEs, programmers often used a basic text editor to write code. They then had to run a compiler or interpreter separately, execute the program manually, and use separate tools for testing and troubleshooting.
An IDE combines many of these activities into one environment. It commonly allows a programmer to:
- Write source code.
- Run the program.
- Test program behavior.
- Identify and correct problems.
- Build a final application for users.
The advantage of an IDE is integration. Instead of constantly switching among separate programs, the programmer can create, execute, test, and prepare an application within one connected workspace.
Visual Basic provides an IDE that makes it easier to create programs and graphical interfaces. This is particularly useful for learning because the environment brings many development tasks together.
Graphical User Interfaces
A graphical user interface, or GUI, is the visual part of a program through which users interact with it.
A GUI may include:
- Windows.
- Buttons.
- Menus.
- Text boxes.
- Icons.
- Images.
- Dialog boxes.
Users interact with a GUI through devices such as a mouse, keyboard, touchscreen, or other input equipment. A phone’s touch interface is a GUI because it provides visible controls that users can tap. A laptop application with menus, buttons, and text fields also uses a GUI.
A GUI is not separate from the program’s instructions. The program contains instructions that create the interface, determine how it appears, and specify how it responds to user actions.
For example, a program may instruct a button to:
- Appear at a particular location.
- Display specific text.
- Respond when clicked.
- Perform an action after the click.
Visual Basic is designed to make GUI development relatively accessible. A programmer can create windows and controls, then write instructions that define what happens when users interact with them.
An application is commonly understood as a program with a graphical user interface. Applications allow users to interact through visible controls and input devices. This contrasts with a text-based program that runs in a command shell or terminal and communicates primarily through typed commands and displayed text.
Think About It
What makes a mobile app a GUI-based application rather than merely a collection of computer instructions?
The Programmer’s Role
A programmer is a person who creates programs, but professional programming involves more than writing code. A programmer typically develops computer-based solutions to problems faced by a company, organization, or group of users.
A programmer might:
- Build a tool for a company’s internal workflow.
- Create part of a larger information system.
- Work as a full-time employee.
- Work as a contract developer.
- Collaborate with other programmers on software sold to customers.
The programmer’s goal is not usually to solve only one isolated example. Instead, the goal is to create a general solution that works for many possible cases.
For example, a programmer should not design a payroll tool that works only for one employee with one specific salary. The tool should handle different employees, salaries, departments, and situations. Similarly, a scheduling program should work with many users and appointment details rather than one fixed appointment.
This requires abstract problem solving. The programmer identifies the general structure of a problem and creates instructions that can work with a range of possible data.
The Programming Workflow
Professional programming follows a process for understanding problems, designing solutions, creating software, and confirming that the software works correctly.
1. Meet with the Users
The first step is to communicate with the people who will use the program. Users understand the practical problem from their own experience, so their input is essential.
A programmer needs to discover:
- What users are trying to accomplish.
- What difficulties they currently face.
- What information the program must accept.
- What results the program must produce.
- Which features would be useful.
- Which parts of the current workflow are missing or inefficient.
A programmer who skips this step may create a technically functional program that does not solve the actual problem.
2. Understand the Problem
The problem must be understood completely before a solution is designed. This includes identifying the required tasks, the information involved, and the conditions the program must handle.
A programmer should think beyond one example. If a company needs an inventory system, the programmer must consider many products, quantities, suppliers, updates, and possible user actions rather than focusing on one product record.
3. Plan the Solution
The programmer should plan how the program will work before writing code. Planning may involve breaking the larger problem into smaller tasks and determining how each task will be handled.
For example, a program might need to:
- Collect information from the user.
- Check whether the information is valid.
- Process the information.
- Store or update data.
- Display a result.
- Allow the user to begin another operation.
Each task can then be analyzed and designed separately.
Beginning to write code without a plan is sometimes called cowboy coding. This approach may feel fast at first, but it can cause confusion, repeated work, and poorly organized programs. Planning provides a structure that guides the coding process.
4. Code the Program
Once the design is understood, the programmer writes the instructions in a programming language. In a Visual Basic program, this may include creating GUI elements, defining properties, and writing responses to events such as button clicks.
The code translates the planned solution into precise instructions that the computer can execute.
5. Test the Program
Testing determines whether the program works correctly and whether it actually helps users.
Testing includes checking for:
- Crashes.
- Incorrect results.
- Missing features.
- Improper responses to user input.
- Problems with unusual or unexpected data.
- Confusing or inconvenient interactions.
Alpha testing focuses primarily on internal correctness. The development team checks whether the program functions, avoids crashes, and performs its instructions properly.
Beta testing involves potential users. It helps determine whether the program solves the users’ real problems and whether they find it understandable and useful.
A program may pass internal testing but still fail to satisfy users. For example, a form might save information correctly but be confusing to complete. Beta testing helps reveal those practical problems.
6. Revise and Repeat
Programming is often an iterative process. Testing may reveal that the program needs changes, so the programmer returns to planning or coding, creates an improved version, and tests again.
In a traditional Software Development Life Cycle, development activities may be organized into larger stages with fewer repeated cycles. In an Agile approach, the team develops a smaller portion of the system, tests it, gathers user feedback, and then repeats the process in short cycles.
Neither approach is automatically best for every situation. The appropriate workflow depends on the project, the available users, the organization, and the type of software being created.
7. Deliver the Final Product
After the program has been developed, tested, and refined, it can be delivered to its users. The final product becomes part of the user’s workflow or information system and helps solve the problem for which it was created.
The programmer’s responsibility is therefore broader than producing code. It includes understanding people, analyzing problems, designing solutions, testing results, and improving the software until it is useful.
Think About It
Why could a program that contains no obvious coding errors still be considered unsuccessful?
Comprehensive Review
Computers are special because they are flexible machines. Unlike traditional machines designed for one primary task, computers can perform many tasks when they receive different instructions. New applications can give a computer new functionality without requiring the physical machine itself to be redesigned.
Programming is the act of creating instructions for a computer. A program is a set of instructions that the computer can follow, while software is a broad term for programs and related computer instructions. Operating systems are also software because they provide the instructions and environment needed for users and applications to interact with computer hardware.
Computers ultimately process binary information represented through electrical states. Binary instructions provide precise control, but they are difficult and inefficient for humans to write directly. Assembly language makes those instructions somewhat more readable, while higher-level programming languages make it much easier to express complex ideas and create sophisticated applications.
Programming languages must be translated into binary instructions through compilation, interpretation, or related mechanisms. A compiler translates code before execution, while an interpreter processes code as the program runs.
Programming paradigms provide different ways to organize and think about programs. Object-oriented programming treats a program as a collection of interacting objects. Objects contain properties, perform behaviors, and communicate with other objects. Classes serve as patterns or blueprints, and objects created from those classes are instances.
An IDE combines tools for writing, running, testing, and building programs. A GUI provides the visual controls through which users interact with an application. Visual Basic supports the creation of GUI-based programs that respond to user input.
Finally, professional programming is a problem-solving process. The programmer communicates with users, studies the problem, plans a general solution, writes code, tests the program, gathers feedback, revises the design, and delivers a useful final product. Programming allows a computer to become a tool that can solve new problems through software rather than being limited to the capabilities built into its original physical design.

Ask anything
We've read this whole study set, so questions about it get the best answers.