Functional Programming Vs Declarative Programming Vs Imperative Programming

前端 未结 4 1417
隐瞒了意图╮
隐瞒了意图╮ 2020-12-07 16:38

I have been too used to Imperative Programming which is the usual way of telling the computer to perform step by step the procedure to get the final result. On the other han

4条回答
  •  北海茫月
    2020-12-07 17:11

    Think of c filters. Where you read from stdin and write to stdout. The code may be imperative but thr program is used like a a function. Say you have a program 'function, then piping to it:

    cat foo  |function |tee bar

    Will filter the contents of foo through function then through the filter tee to both write to stdout and create bar . Think also of grep and awk the iterator in both is implied and they are used like functions.

提交回复
热议问题