A program is a sequence of instructions that specifies how to perform a computation. The computation might be something as complex as rendering an html page in a web browser or encoding a video and streaming it across the network. It can also be a symbolic computation, such as searching for and replacing text in a document or (strangely enough) a program that is designed to compile another program.
Believe it or not, thatβs pretty much all there is to it. Every program youβve ever used, no matter how complicated, is made up of instructions that look more or less like these. Thus, we can describe programming as the process of breaking a large, complex task into smaller and smaller subtasks until the subtasks are simple enough to be performed with sequences of these basic instructions.
It is just step-by-step instructions that the computer can understand and execute. Programs often implement algorithms, but note that algorithms are typically less precise than programs and do not have to be written in a programming language.
Programs often implement algorithms, but they are not the same thing. An algorithm is a step by step list of instructions, but those instructions are not necessarily precise enough for a computer to follow. A program must be written in a programming language that the computer knows how to interpret.