程序语言 | 编程范式/泛型一览

  • 命令式,指示程序如何改变状态

    imperative: in which the programmer instructs the machine how to change its state
    - procedural which groups instructions into procedures
    - object-oriented which groups instructions with the part of the state they operate on

  • 声明式:只说结果,不说过程

    declarative: in which the programmer merely declares properties of the desired result, but not how to compute it

一、命令式

指示程序如何改变状态

1.过程式 (Procedural programming)

采取过程调用或函数调用的方式来进行流程控制,包括一系列运算步骤的过程(Procedures),例程(routines),子程序(subroutines), 方法(methods),或函数(functions)来控制。在程序执行的任何一个时间点,都可以调用某个特定的程序。任何一个特定的程序,也能被任意一个程序或是它自己本身调用。

2.面向对象(Object-oriented programming,OOP)

对象则指的是类(class)的实例。它将对象作为程序的基本单元,将程序和数据封装其中,以提高软件的重用性、灵活性和扩展性,对象里的程序可以访问及经常修改对象相关连的数据。

二、声明式

只说结果,不说过程

1.functional

in which the desired result is declared as the value of a series of function applications: OCaml, Haskell

2.logic

in which the desired result is declared as the answer to a question about a system of facts and rules: Prolog

3.mathematical

in which the desired result is declared as the solution of an optimization problem: . Wolfram Language, Matlab

3.reactive

in which the desired result is declared with data streams and the propagation of change: Verilog

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值