In computer programming, a paradigm refers to a specific approach or style of programming. It represents a set of principles, concepts, and techniques that guide how software is designed, structured, and executed. Each paradigm has its own set of rules, methodologies, and patterns for solving problems. There are several commonly recognized programming paradigms, including:

Imperative Programming

This paradigm focuses on describing the steps and procedures that a program should follow to reach a desired state. It emphasizes changing program state through sequential instructions and control flow constructs like loops and conditionals.

Object-Oriented Programming (OOP)

OOP organizes code around objects that encapsulate data and behavior. It emphasizes concepts such as classes, objects, inheritance, and polymorphism. OOP promotes modularity, reusability, and ease of maintenance.

Functional Programming

Functional programming treats computation as the evaluation of mathematical functions. It emphasizes immutability, pure functions without side effects, and higher-order functions. Functional programming promotes declarative and concise code.

Procedural Programming

Procedural programming focuses on defining procedures (subroutines or functions) that operate on data. It follows a top-down approach where the program is divided into smaller procedures that perform specific tasks.

Declarative Programming

Declarative programming focuses on describing what should be achieved rather than how to achieve it. It includes languages like SQL (for database queries) and markup languages like HTML (for describing the structure of web pages).

Event-Driven Programming

Event-driven programming is based on reacting to events or user actions. It often involves event handlers or callbacks that respond to specific events or signals.

Here’s a table that provides some popular programming languages along with the paradigms they support and the paradigms they are commonly associated with:

Language Supported Paradigms Favored Paradigms
Python Procedural, Object-Oriented, Functional Object-Oriented, Functional, Imperative
C Procedural Procedural
Java Object-Oriented, Imperative, Functional Object-Oriented, Imperative
JavaScript Procedural, Object-Oriented, Functional Object-Oriented, Functional, Imperative
C++ Procedural, Object-Oriented Object-Oriented, Procedural
C# Procedural, Object-Oriented Object-Oriented
Ruby Object-Oriented, Functional Object-Oriented, Functional
Go Procedural, Concurrent Procedural, Concurrent
Swift Object-Oriented, Protocol-Oriented Object-Oriented Protocol-Oriented
Kotlin Object-Oriented, Functional Object-Oriented, Functional
PHP Procedural, Object-Oriented Object-Oriented, Procedural
Rust Procedural, Object-Oriented Object-Oriented, Functional, Procedural
Scala Object-Oriented, Functional Object-Oriented, Functional
Haskell Functional Functional
Lisp Functional Functional, Procedural
Prolog Logic Logic

Imperative Programming (C):

#include <stdio.h>

int main() {
    int a = 5;
    int b = 10;
    int sum = a + b;
    printf("The sum is: %d\n", sum);
    return 0;
}

Object-Oriented Programming (Java):

public class Rectangle {
    private int width;
    private int height;

public Rectangle(int width, 
int height)
 {
    this.width = width;
    this.height = height;
    }

public int calculateArea() {
        return width * height;
    }

public static void 
main(String[] args) 
{
    Rectangle rectangle 
    = new Rectangle(5, 10);
    int area
     = rectangle.calculateArea();
    System.out.println("The 
    area is:
     " + area);
    }
}

Functional Programming (JavaScript):

const numbers = [1, 2, 3, 4, 5];

const doubledNumbers = 
numbers.map(
    (num) => num * 2);
// Output: [2, 4, 6, 8, 10]
console.log(doubledNumbers); 

Procedural Programming (C):

#include <stdio.h>

int sum(int a, int b) {
    return a + b;
}

int main() {
    int result = sum(5, 10);
    printf("The sum is: %d\n", 
    result);
    return 0;
}

Declarative Programming (SQL):

SELECT * FROM users WHERE age > 18;

Event-Driven Programming (JavaScript)

const button = 
document.querySelector("#myButton");

button.addEventListener("click",
 () => {
    console.log("Button clicked!");
});