What Is Computer Programming?

Programming code is human-written instructions for computers

artists version of data upload in progress.

 PeopleImages.com / Getty Images

Programming is a creative process that instructs a computer on how to do a task. Hollywood has helped instill an image of programmers as uber techies who can sit down at a computer and break any password in seconds. The reality is far less interesting.

So Programming Is Boring? 

Computers do what they are told, and their instructions come in the form of programs written by humans. Many knowledgeable computer programmers write source code that can be read by humans but not by computers. In many cases, that source code is compiled to translate the source code into machine code, which can be read by computers but not by humans. These compiled computer programming languages include:

Some programming does not need to be compiled separately. Rather, it is composed of a just-in-time process on the computer for which it is running. These programs are called interpreted programs. Popular interpreted computer programming languages include:

  • Javascript
  • Perl
  • PHP
  • Postscript
  • Python
  • Ruby

Programming languages each require knowledge of their rules and vocabulary. Learning a new programming language is similar to learning a new spoken language.

What Do Programs Do?

Fundamentally programs manipulate numbers and text. These are the building blocks of all programs. Programming languages let you use them in different ways by using numbers and text and storing data on disk for later retrieval.

These numbers and text are called variables, and they can be handled singly or in structured collections. In C++, a variable can be used to count numbers. A struct variable in code can hold payroll details for an employee such as:

  • Name
  • Salary
  • Company Id Number
  • Total Tax Paid
  • SSN

A database can hold millions of these records and fetch them rapidly.

Programs Are Written for Operating Systems

Each computer has an operating system, which is itself a program. The programs that run on that computer must be compatible with its operating system. Popular operating systems include: 

  • Windows
  • Linux
  • MacOS
  • Unix
  • Android

Before Java, programs had to be customized for each operating system. A program that ran on a Linux computer could not run on a Windows computer or a Mac. With Java, it is possible to write a program once and then run it everywhere as it is compiled to a common code called bytecode, which is then interpreted. Each operating system has a Java interpreter written for it and knows how to interpret bytecode. 

Much computer programming occurs to update existing applications and operating systems. Programs use features provided by the operating system and when those change, the programs must change.

Sharing Programming Code

Many programmers write software as a creative outlet. The web is full of websites with source code developed by amateur programmers who do it for fun and are happy to share their code. Linux started this way when Linus Torvalds shared code he had written.

The intellectual effort in writing a medium-sized program is comparable to writing a book, except you never need to debug a book. Computer programmers find joy in discovering new ways to make something happen or in solving a particularly thorny problem. 

Format
mla apa chicago
Your Citation
Bolton, David. "What Is Computer Programming?" ThoughtCo, Apr. 5, 2023, thoughtco.com/what-is-programming-958331. Bolton, David. (2023, April 5). What Is Computer Programming? Retrieved from https://www.thoughtco.com/what-is-programming-958331 Bolton, David. "What Is Computer Programming?" ThoughtCo. https://www.thoughtco.com/what-is-programming-958331 (accessed March 19, 2024).