Log in Sign up
Back to Discover
💻

Programming paradigm

technology Maturity 5-7

People use many ways to talk to computers.

Programming paradigms.svg
Programming paradigms.svg
Some ways use steps. Other ways use groups. These ways help us build tools. They make our world work. How do you use a computer?
Programming paradigms.svg
Programming paradigms.svg

37 words

People use different ways to talk to computers.

Programming paradigms.svg
Programming paradigms.svg
These ways are like sets of rules. Some rules use a list of steps. This tells the computer exactly what to do.
Programming paradigms.svg
Programming paradigms.svg
Other rules use groups of things. These groups can hold data and actions. Some ways tell the computer what the end result should be. The computer then finds the best way to do it. These different ways help people build many tools. Using these rules makes it easier to write code.

85 words

People use different ways to write computer code. We call these ways programming paradigms. A paradigm is a way to think about a program.

Programming paradigms.svg
Programming paradigms.svg
It helps a person plan how the code will work. Some languages use only one paradigm. Other languages can use many different ones.

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.

Programming paradigms.svg
Programming paradigms.svg

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.

181 words

A programming paradigm is a high-level way to plan a computer program. It is a way to think about how to structure code.

Programming paradigms.svg
Programming paradigms.svg
Different languages use different paradigms to get work done. Some languages only use one way of thinking. For example, the language Smalltalk uses object-oriented programming. The language Haskell uses functional programming. Most modern languages can actually use many different paradigms at once. A person writing code might choose different parts of a language to solve a problem.
Programming paradigms.svg
Programming paradigms.svg

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.

Programming paradigms.svg
Programming paradigms.svg
The second way is called declarative programming. This way does not give a list of steps. Instead, it describes the result you want to see. The computer then decides the best order to run the operations.

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.

Programming paradigms.svg
Programming paradigms.svg
In the early days, programming was very different. Many early programs used something called a goto statement. This often created "spaghetti code" that was very hard to fix. To solve this, researchers created structured programming to make code cleaner.

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.

Programming paradigms.svg
Programming paradigms.svg
Other types include visual programming, where you use pictures instead of text. There is even a new way called vibe coding. In vibe coding, a person uses natural language to describe a program. Then, an AI helps write and improve the code.

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.

Programming paradigms.svg
Programming paradigms.svg
Some people use tools that focus on math, while others use tools that focus on objects. Even though they all build something, the way they think is different. Learning these different ways helps people build much better tools. It makes it easier to understand how a program will behave. It also helps people prove that a program is correct.

465 words

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.

Programming paradigms.svg
Programming paradigms.svg

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.

Programming paradigms.svg
Programming paradigms.svg

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.

Programming paradigms.svg
Programming paradigms.svg

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.

Programming paradigms.svg
Programming paradigms.svg

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."

Programming paradigms.svg
Programming paradigms.svg

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.

Programming paradigms.svg
Programming paradigms.svg

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.

Programming paradigms.svg
Programming paradigms.svg

653 words
🖼️ Images & Media (1)
File:Programming paradigms.svg
Programming paradigms.svg
Up Next
💻
Imperative programming
Technology
More to explore

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.