Science Fair Project Encyclopedia
A programming paradigm provides (and determines) the view that the programmer has of the execution of the program. For instance, in object-oriented programming, programmers can think of a program as a collection of interacting objects, while in functional programming a program can be thought of as a sequence of stateless function evaluations.
Just as different groups in software engineering advocate different methodologies, different programming languages advocate different programming paradigms. Some languages are designed to support one particular paradigm (Smalltalk and Java support object-oriented programming while Haskell and Scheme support functional programming), while other programming languages support multiple paradigms (such as Common Lisp, Python, and Oz.)
Many programming paradigms are as well-known for what techniques they forbid as for what they enable. For instance, pure functional programming disallows the use of side-effects; structured programming disallows the use of goto. Partly for this reason, new paradigms are often regarded as doctrinaire or overly rigid by those accustomed to earlier styles. However, this avoiding of certain techniques can make it easier to prove theorems about a program's correctness -- or simply to understand its behavior -- without limiting the generality of the programming language.
The relationship between programming paradigms and programming languages can be complex since a programming language can support multiple paradigms. For example, C++ is designed to support elements of procedural programming, object-based programming, object-oriented programming, and generic programming. However, designers and programmers decide how to build a program using those paradigm elements. One can write a purely procedural program in C++, one can write a purely object-oriented program in C++, or one can write a program that contains elements of both paradigms.
In theoretical computer science, one particular paradigm, known as the lambda calculus, stands above all the rest; it has been shown (see Turing machine) that most relevant computations can be expressed in those terms.
Examples of Programming Paradigms
- Structured programming, compared to Unstructured programming
- Imperative programming, compared to Declarative programming
- Procedural programming, compared to Functional programming
- Value-level programming, compared to Function-level programming
- Flow-driven programming, compared to Event-driven programming
- Scalar programming, compared to Array programming
- Class-based programming, compared to Prototype-based programming (within the context of Object-oriented programming)
- Rule-based programming, compared to Constraint programming (within the context of Logic programming)
- Component-oriented programming (as in OLE)
- Aspect-oriented programming (as in AspectJ)
- Symbolic programming (as in Mathematica)
- Table-Oriented Programming (as in Microsoft FoxPro)
- Post-object programming
- Subject-oriented programming
- Reflective programming
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details