People use many ways to talk to computers.
People use different ways to talk to computers.
People use different ways to write computer code. We call these ways programming paradigms. A paradigm is a way to think about a program.
One way is called imperative programming. This way gives the computer a list of steps. It tells the computer exactly what to do and when to do it. Another way is called declarative programming. In this way, you describe what you want to see. You do not tell the computer every step to get there. The computer finds the best way to do the work.
There is also object-oriented programming. This way organizes code into objects. These objects hold both data and actions. Programs can then act like a set of objects talking to each other. Some people also use functional programming. This treats a program like a series of math tasks. It avoids changing data while the program runs. These different ways help people build many kinds of tools.
A programming paradigm is a high-level way to plan a computer program. It is a way to think about how to structure code.
There are two main ways that code can work. The first way is called imperative programming. This method gives the computer a specific list of steps. It tells the machine exactly what to do and in what order. It also allows side effects, which means the program can change data at one time and read it later.
People have studied these different ways for a long time. The idea of a paradigm comes from computer science research. This research helps people compare different ways to write software. The concept of a paradigm was used by Thomas Kuhn in 1962. Later, Robert W. Floyd gave a famous lecture about them in 1978.
Many different types of paradigms exist today. Object-oriented programming organizes code into objects. These objects hold both data and the actions that go with it. Functional programming treats a program like a series of math tasks. There is also concurrent programming for computers with many processors. This allows many tasks to happen at the same time.
You can think of paradigms like different styles of building. One person might build with blocks that snap together. Another might build by following a very strict set of instructions.
A programming paradigm is a high-level way to conceptualize and structure a computer program. It is not a specific language, but rather a way of thinking about how to organize code. Paradigms help developers categorize different approaches to solving problems with software. A single programming language might support only one paradigm, or it might support many. For example, the language Smalltalk is built around the object-oriented paradigm. In contrast, the language Haskell is centered on the functional paradigm. Most modern languages are multi-paradigm, meaning they allow developers to use different styles within one program.
To understand how these work, we can look at the two primary dimensions of programming. The first dimension involves the execution model. This determines how the computer actually carries out the instructions. One side of this dimension is imperative programming. In this model, the code directly controls the execution flow and changes the state of the program. It uses explicit statements to tell the machine exactly what to do and in what order. This allows for side effects, where a piece of code changes data that another part of the program reads later.
The opposite side of this dimension is declarative programming. In a declarative model, the programmer describes the desired result rather than the specific steps to reach it. The code declares what the computation should perform without specifying detailed state changes. The language's execution model then decides the best order to run the operations. This is different from imperative code, which dictates the sequence of operations. By focusing on the "what" instead of the "how," declarative programming can simplify complex logic.
Another major dimension is how the code is organized. Object-oriented programming is a very common way to structure software. It organizes code into objects that contain both data structures and associated behaviors. These objects interact with one another to complete tasks. There are different ways to implement this. Class-based programming uses abstract data types and inheritance to create objects. Prototype-based programming avoids classes and instead uses the cloning of existing instances to achieve inheritance. There is also object-based programming, which uses objects to encapsulate state and behavior but does not use subtyping or inheritance.
History shows that these approaches have evolved to solve specific problems. In the mid-1960s, researchers began advocating for structured programming. Before this, early programs often used "goto" statements to jump between different parts of the code. This frequently resulted in "spaghetti code," which was very difficult to maintain or understand. Structured programming solved this by disallowing goto statements and requiring more organized constructs. The term "paradigm" itself was used by Thomas Kuhn in 1962. Later, in 1978, Robert W. Floyd gave a famous Turing Award lecture titled "The Paradigms of Programming."
Modern computing has led to even more specialized paradigms. Concurrent programming is used for systems with many processors. It uses constructs like multi-threading or message passing to handle many tasks at once. There is also distributed programming, which supports multiple autonomous computers communicating over a network. For specific mathematical needs, developers use functional programming. This treats a program as a sequence of stateless function evaluations and avoids mutable data. Even newer methods like "vibe coding" are emerging. In vibe coding, a person uses natural language to describe a program, and an AI generates and improves the code.
While paradigms help us organize our thoughts, they are also used to define what a language forbids. For example, pure functional programming disallows side effects. Structured programming disallows the use of the goto construct. Some researchers argue that strictly classifying languages into single paradigms is difficult. This is because many languages include features from several different paradigms at once. Regardless of the classification, choosing the right paradigm can make it easier to understand how a program behaves. It can also help programmers prove that their software is correct and reliable.
🖼️ Images & Media (1)
More to explore
✨ What else?
Related topics you might enjoy
🔬 Go deeper
More advanced topics to explore
🪜 Step back
Simpler topics to build understanding
What is Nepedia?
A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.