Comments on Winter-cn's article on functional programming

Source: Internet
Author: User

Winter-cn has a lot of knowledge about programming methodology. I often write my own opinions, such:

The complexity of functional programming (very messy)

 

After reading it, I did not agree with some of his points and wrote such a comment:

First, I disagree with your statement as follows:

Reference

So if you really want to understand the functional formula, the key is the change of concept-you must completely discard the previous ideas.

For functional programming, there are still some problems. As for the reasons, we should use Winter-cn's own words to prove that:

Reference

No function cares about the order in which its parameters are evaluated.
However, no function is executed before its own parameter is evaluated.
So put (open the door (refrigerator), the elephant will certainly be executed after the door (refrigerator.

This section at least makes it clear that no function will be executed before its own parameter is evaluated. Do you have any order.
As for the multiple parameters you mentioned, theoretically multiple parameters can be performed simultaneously. But it is usually not. For example, the compiler regularly first compiles or the interpreter first interprets a parameter.

I may not fully understand or express one of my functional programming methods. Functional programming is a bit like a lot of box with names, large boxes and small boxes, a small box contains a smaller one. A box can contain several small boxes. It is the largest box on the outermost side. All the boxes are installed. For a box with multiple small boxes, the order depends on the person who installs the box. He can install the box according to his idea, and he can arrange the order of the box by color (if any ), you can also sort by size or by weight. Of course, if he can take several boxes at a time, he can also put several small boxes into the big box at the same time. In short, the execution of this program is like a box installation process.

In the last sentence, functional programming is just a manifestation. The essence is the most important. It is actually an algorithm.

 

To express my understanding of the function. It is to use a box to compare a function. The reason why we think of such a metaphor is mainly to see a pair of parentheses, just like a box, which has the meaning of packaging.

 

Related Article

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.