Functional Programming Paradigm

Source: Internet
Author: User

One feature of functional programming languages is that there are no variables, and the Python section supports functional programming paradigms, but not purely functional languages.

What is functional programming? Simple answer: Everything is a mathematical function. Functional programming languages can also have objects, but usually these objects are constant--or function parameters, what is the function return value. There is no For/next loop in functional programming languages, because these logic implies a state change. Instead, the cyclic logic is implemented in a functional programming language by recursion and by passing functions as parameters.

There is a better argument for why functional programming is used, and modern applications involve parallel computing functions on multicore computers, and the state of the program becomes a problem. All imperative languages, including object-oriented languages, encounter state modification issues with shared objects when multi-threading is involved. This is the root cause of the deadlock, stack trace, low-level processor cache hit ratio, and so on. If the object has no state, these problems do not exist.

Functional programming can solve the state problem of parallel operation, but the cost is to lose human readability.

Functional Programming Paradigm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.