This commit is contained in:
Miloslav Ciz 2025-03-12 16:58:53 +01:00
parent 5dbd5b164a
commit 53bd3b4b91
14 changed files with 1966 additions and 1937 deletions

View file

@ -1,6 +1,6 @@
# Paradigm
By [programming language](programming_language.md)'s paradigm (from Greek *paradeigma*, "pattern", "example") we mean the very basic concepts used as a basis for performing computation in that language. Among the most popular paradigms we'll find for example the [imperative](imperative.md), [object oriented](oop.md) and [functional](functional.md), but there exist many others; we may view every paradigm as a set of basic ideas, principles and [mathematical](math.md) models (e.g. [models of computation](model_of_computation.md), [data types](data_type.md), forms of [expressions](expression.md) etc.) that form the foundation of how the whole language works; these foundations are subsequently also accompanied by a kind of "programming philosophy" (we'll oftentimes hear sentences such as "[everything is](everything_is.md) X" where *X* may be *number*, *object*, *array*, *list* etc.), a naturally emerging "mindset", a set of recommendations the programmer should follow when using the language. But let it be set straight that paradigm will NOT include other than purely technical, engineering aspects of computation, i.e. artistic or political ideas (such as "eco-friendlieness", "anti-fascism", ...) are indeed not part of programming paradigm. Nevertheless, although of technical nature, aspects of paradigms are subjective, for example the question of drawing borders between them -- just like [music](music.md) genres or human [races](race.md), paradigms are [fuzzy](fuzzy.md) concepts, they have different definitions in different books, come in different flavors and are often combined; sometimes it's unclear how to classify paradigms (if one strictly falls under another etc.) or even if something is or isn't a paradigm at all.
By [programming language](programming_language.md)'s paradigm (from Greek *paradeigma*, "pattern", "example") we mean the very basic concepts used as a basis for performing computation in that language. Among the most popular paradigms we'll find for example the [imperative](imperative.md), [object oriented](oop.md) and [functional](functional.md), but there exist many others; we may view every paradigm as a set of basic ideas, principles and [mathematical](math.md) models (e.g. [models of computation](model_of_computation.md), [data types](data_type.md), forms of [expressions](expression.md) etc.) that form the foundation of how the whole language works; these foundations are subsequently also accompanied by a kind of "programming philosophy" (we'll oftentimes hear sentences such as "[everything is](everything_is.md) X" where *X* may be *number*, *object*, *array*, *list* etc.), a naturally emerging "mindset", a set of recommendations the programmer should follow when using the language. But let it be set straight that paradigm will NOT include other than purely technical, engineering aspects of computation, i.e. artistic or political ideas (such as "eco-friendlieness", "anti-fascism", ...) are indeed not part of programming paradigm. Nevertheless, although of technical nature, aspects of paradigms are subjective, for example the question of drawing borders between them -- just like [music](music.md) genres or human [races](race.md), paradigms are [fuzzy](fuzzy.md) concepts, they have different definitions in different books, come in different flavors and are often combined; sometimes it's unclear how to classify paradigms (if one strictly falls under another etc.) or even if something is or isn't a paradigm at all. In a wider sense the term *paradigm* may also be used outside of programming languages, for example a paradigm of a [physics engine](physics_engine.md) might be "everything's a sphere" etc.
For example the [functional](functional.md) paradigm is built on top of [lambda calculus](lambda_calculus.md) (one of many possible mathematical systems that can be used to perform general calculations) which performs calculations by combining pure mathematical [functions](function.md) -- this then shapes the language so that a programmer will mostly be writing mathematical functions in it, AND this also usually comes with the natural "philosophy" of subsequently viewing everything as a function, even such things as loops or [numbers](number.md) themselves. In contrast [object oriented](oop.md) (OOP) paradigm tries to solve problems by constructing a network of intercommunicating "objects" and so in OOP we tend to see most things as objects.