码迷,mamicode.com
首页 > 其他好文 > 详细

Comparison of programming paradigms

时间:2018-01-12 21:17:57      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:step   tran   clu   org   pass   nes   each   key   cts   

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

标签:step   tran   clu   org   pass   nes   each   key   cts   

原文地址:https://www.cnblogs.com/feng9exe/p/8277500.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!