In this note, we will explore the technical domain of programming, characterized by the goal of designing and implementing a program, and structured through a set of
building blocks
,techniques
,processes
,guiding principles
, and the more abstract and encompassing programming models (paradigms).
Programming → A technical domain; the practice and craft of building programs.
A program is a finite sequence of instructions that a computer can execute to perform a specific task or set of tasks.
Program → A specification or theory of a computation.
System → A broader, interacting set of programs, components, or hardware designed to accomplish one or more tasks.
Note: The distinction between Program and System is somewhat arbitrary; it is made primarily for cognitive convenience.
A program is a finite, well-defined sequence of instructions that a computer can execute to perform specific tasks. It can also be viewed as a formal specification or theory of a computation.
Aspect | Description |
---|---|
Definition | A finite sequence of instructions a computer can execute; also a specification or theory of computation. |
Inputs and Outputs | Processes input data and produces outputs, which can be displayed, stored, or sent to other systems. |
State | Maintains internal state that evolves during execution; can be implicit (variables) or explicit (state machines). |
Behavior | Describes how inputs are transformed into outputs, including control flow, data flow, and side effects. |
Environment | Executes within hardware and software context (OS, libraries, networks, peripherals). |
Correctness and Specification | Degree to which program conforms to its specification; can be formally or informally defined. |
Complexity | Time complexity (execution duration) and space complexity (memory usage). |
Modularity and Composition | Composed of reusable functions, classes, or components; supports reuse and combination. |
Executability | Can be executed directly by hardware (compiled) or via interpreter/virtual machine. |
Maintainability and Evolution | Can be modified, extended, or optimized over time. |
Representation | Exists in multiple forms: source code, intermediate code, machine code, or formal models. |
The process of defining what a program should do and how it should do it.
Program design is the disciplined, formal process of constructing the internal structure and behavior of a software artifact such that it satisfies a given specification, under resource constraints, by selecting and organizing computational abstractions (e.g., data types, control structures, and interfaces) into coherent, composable units (e.g., functions, classes, modules) that collectively realize a correct, maintainable, and efficient program.
Design decisions depend on the level of abstraction, ranging from low-level (hardware-near) to high-level (conceptual or domain-specific).
See more in Building Block.
Building blocks provided by a programming language, such as variables, functions, classes, types, and control structures.