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
ImperativePrograms as statements that directly change computed state (datafields)Direct assignments, common data structuresglobal variables Edsger W. DijkstraMichael A. JacksonCC++JavaPHPPythonRuby
StructuredA style of imperative programming with more logical program structureStructogramsindentation, no or limited use of goto statementsImperative CC++JavaPython
ProceduralDerived from structured programming, based on the concept of modular programming or the procedure callLocal variables, sequence, selection, iteration, and modularizationStructured, imperative CC++LispPHPPython
FunctionalTreats computation as the evaluation of mathematical functions avoiding state and mutable dataLambda calculuscompositionalityformularecursionreferential transparency, no side effectsDeclarative C++,[1] ClojureCoffeescript,[2] ElixirErlangF#HaskellLispPythonRubyScalaSequenceLStandard MLJavaScript
Event-drivenincluding time-drivenControl flow is determined mainly by events, such as mouse clicks or interrupts including timerMain loop, event handlers, asynchronous processesProcedural, dataflow JavaScriptActionScriptVisual BasicElm
Object-orientedTreats datafields as objects manipulated through predefined methods onlyObjects, methods, message passinginformation hidingdata abstractionencapsulationpolymorphisminheritanceserialization-marshallingProceduralHere and[3][4][5]Common LispC++C#EiffelJavaPHPPythonRubyScalaJavaScript[6][7]
DeclarativeDefines program logic, but not detailed control flowFourth-generation languagesspreadsheetsreport program generators  SQLregular expressionsCSSPrologOWLSPARQL
Automata-based programmingTreats programs as a model of a finite state machine or any other formal automataState enumerationcontrol variablestate changes, isomorphismstate transition tableImperative, event-driven Abstract State Machine Language

Differences in terminology

 

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

转载于:https://www.cnblogs.com/feng9exe/p/8277500.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值