Programming paradigm
A programming paradigm is a fundamental style or approach to programming that dictates how programmers structure and write code to solve problems. It encompasses a set of principles, techniques, and patterns for organizing code and thinking about program execution.
Common programming paradigms are:
-
Imperative programming: Focuses on explicitly describing the steps the computer must take to achieve a desired state. Procedural programming is a sub-category of imperative programming.
-
Declarative programming: Focuses on describing what the program should accomplish without explicitly listing commands or steps.
-
Functional programming (FP): A sub-category of declarative programming, functional programming emphasizes the use of mathematical functions and avoids changing state or mutable data.
-
Concatenative programming: A concatenative programming language is a functional programming paradigm in which programs are built by composing (concatenating) functions.
-
Object-oriented programming (OOP): Organizes code into objects that contain both data and methods, promoting encapsulation, inheritance, and polymorphism.
-
Logic programming: Uses formal logic to express computations, where the desired result is declared as the answer to a query about a system of facts and rules.
-
Stack language: A stack language is one in which the execution model involves pushing operands onto a stack, from which operators consume or produce stack values.
Programming languages commonly exhibit characteristics of multiple programming paradigms.