Functional Programming (0)-What is functional programming

Source: Internet
Author: User

What is functional programming (functional programming)? Functional programming is to write programs with functions. The answer is too abstract to say.

And make it clear: functional programming is like building blocks, taking functions as blocks of blocks, outputting input functions as wedges and wedges, and combining the output of one function as input of another function into a larger function. The whole process of building blocks is functional programming. Well, this is a little bit clearer, but what do you do? There are instruction programming modes (imperative programming) relative to the functional programming pattern. Our familiar OOP programming is the instruction programming pattern. In instruction programming, we use a sequence of instructions to change some variables in the program to realize the whole program state transition. In functional programming, we first combine some specific functions in a specific way to form a separate large function, and then input some things into the input of this large function. When the input passes through the zigzag channel formed by the internal component function input output, the desired result is produced (much like the deformation process of the input object). Inputs each pass through a component function, the state of the program will undergo some changes, the whole process is actually the state of the program of the deformation (transformation). So, can it be said that instruction programming corresponds to variable assignment, functional programming is equivalent to a function combination? In fact, the word "function combination" is the soul of functional programming, and English is functional composition. So, is that a little clearer? But for those of us who have used OOP programming for a lifetime, the way in which functional programming realizes state transitions is wonderfully unpredictable, as opposed to setting a variable with a single instruction to see the result directly. Don't worry, it takes a process to change ideas. Be aware that functional programming is a new category of programming.

If functional programming is a combination of functions, this is a completely new way of programming. How do you implement a combination of functions? Functional programming is based on mathematical theory (-culculus), and the combination of program functions is achieved by the combination of mathematical functions. Well, it's a whole new concept, so let's learn from the beginning.

Functional Programming (0)-What is functional programming

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.