Comparison of programming paradigms

Posted zzfx

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Comparison of programming paradigms相关的知识,希望对你有一定的参考价值。

Main paradigm approaches[edit]

The following are widely considered the main programming paradigms, as seen when measuring programming language popularity. There is some overlap between paradigms, inevitably, but the main features or identifiable differences are summarized in this table:

None of the main programming paradigms have a precise, globally unanimous definition, nor official international standard. Nor is there any agreement on which paradigm constitutes the best method to developing software. The subroutines that implement OOP methods may be ultimately coded in an imperative, functional, or procedural style that may, or may not, directly alter state on behalf of the invoking program.

ParadigmDescriptionMain traitsRelated paradigm(s)CritiqueExamples
Imperative Programs as statements that directly change computed state (datafields) Direct assignments, common data structuresglobal variables   Edsger W. DijkstraMichael A. Jackson CC++JavaPHPPythonRuby
Structured A style of imperative programming with more logical program structure Structogramsindentation, no or limited use of goto statements Imperative   CC++JavaPython
Procedural Derived from structured programming, based on the concept of modular programming or the procedure call Local variables, sequence, selection, iteration, and modularization Structured, imperative   CC++LispPHPPython
Functional Treats computation as the evaluation of mathematical functions avoiding state and mutable data Lambda calculuscompositionalityformularecursionreferential transparency, no side effects Declarative   C++,[1] ClojureCoffeescript,[2] ElixirErlangF#HaskellLispPythonRubyScalaSequenceLStandard MLJavaScript
Event-drivenincluding time-driven Control flow is determined mainly by events, such as mouse clicks or interrupts including timer Main loop, event handlers, asynchronous processes Procedural, dataflow   JavaScriptActionScriptVisual BasicElm
Object-oriented Treats datafields as objects manipulated through predefined methods only Objects, methods, message passinginformation hidingdata abstractionencapsulationpolymorphisminheritanceserialization-marshalling Procedural Here and[3][4][5] Common LispC++C#EiffelJavaPHPPythonRubyScalaJavaScript[6][7]
Declarative Defines program logic, but not detailed control flow Fourth-generation languagesspreadsheetsreport program generators     SQLregular expressionsCSSPrologOWLSPARQL
Automata-based programming Treats programs as a model of a finite state machine or any other formal automata State enumerationcontrol variablestate changes, isomorphismstate transition table Imperative, event-driven   Abstract State Machine Language

Differences in terminology

 

https://en.wikipedia.org/wiki/Comparison_of_programming_paradigms

以上是关于Comparison of programming paradigms的主要内容,如果未能解决你的问题,请参考以下文章

Comparison of video container formats

转A Technical Comparison of TTLS and PEAP

Comparison of Android versions(strcmp的应用)

HDOJ 5099 Comparison of Android versions 坑题

A comparison of local caches 本地缓存之比较

Venn Diagram Comparison of Boruta, FSelectorRcpp and GLMnet Algorithms