- Design Patterns and Best Practices in Java
- Kamalmeet Singh Adrian Ianculescu LUCIAN PAUL TORJE
- 259字
- 2021-06-25 20:52:28
Functional programming
Functional programming is a sub-paradigm of declarative programming. As opposed to imperative programming, functional programming does not change the internal state of the program.
In imperative programming, the functions can be regarded more as sequences of instructions, routines, or procedures. They not only depend on the state stored in the memory but can also change that state. This way, invoking an imperative function with the same arguments can produce different results depending on the current program's state, and at the same time, the executed function can change the program's variables.
In functional programming terminology, functions are similar to mathematical functions, and the output of a function depends only on its arguments, regardless of the program's state, which, at the same time, remains unaffected by the execution of the function.
Paradoxically, while imperative programming has existed since computers were first created, the basic concepts of functional programming dates back before that. Most functional languages are based on lambda calculus, a formal system of mathematical logic created in the 1930s by mathematician Alonzo Church.
One of the reasons why functional languages become so popular in those days is the fact that they can easily run in parallel environments. This should not be confused with multithreading. The main feature that allows functional languages to run in parallel is the basic principle on which they reside: the functions rely only on the input arguments and not on the program's state. That is, they can be run anywhere, and the results of the multiple parallel executions are then joined and used further.
- Vue.js 3.x快速入門
- 大話PLC(輕松動漫版)
- Spring Cloud Alibaba核心技術與實戰案例
- Getting Started with Gulp(Second Edition)
- Vue.js入門與商城開發實戰
- x86匯編語言:從實模式到保護模式(第2版)
- RTC程序設計:實時音視頻權威指南
- React.js Essentials
- Learn Programming in Python with Cody Jackson
- 教孩子學編程:C++入門圖解
- Mastering RStudio:Develop,Communicate,and Collaborate with R
- Linux操作系統基礎案例教程
- Visual Foxpro 9.0數據庫程序設計教程
- Java Web開發就該這樣學
- Modular Programming with JavaScript