Functional programming is no longer a new concept. In addition, functional programming is suspended from time to time on various technical forums and news websites. However, for many write applicationsProgramFor programmers, functional programming is still so unfamiliar and far away. Confusion initiated a question on tweakblog.net aboutProgramming LanguageThere is no popular discussion.
Confusion believes that functional programming languages are not popular because their documents and examples are too complex and difficult to understand:
Some authority in the software engineering field deeply regrets the fact that function programming (functional programming-FP) is not very popular. Supporters often blame the audience for being short-sighted or their boss for being incompetent, believing that those who disagree with them do not understand what functional programming is. This, in turn, may indicate that they did not give an appropriate explanation.
The actual reason I want to limit the adoption of the FP language is: the advantages of functional programming language are really attracting everyone, but these advantages are not well described and examples. Likewise, these interpretations and examples seem very unsuccessful in persuading software engineers because they do not answer questions that software engineers are concerned about in their daily work.
Then confusion further illustrates this with an example about the definition of reduce:
(Reduce f x) Nil = x
(Reduce f x) (cons a L) = f a (reduce f x) L)
......
This is abstract and is unfamiliar to most people. However, FP documents only contain such very mathematical examples. No one has written an example of a pet store that proves the powerful functionality of FP? This is what most of us do.
This view of confusion has attracted discussion from many readers, who have expressed their views on this issue. Raynbow expresses different opinions on the over-abstraction of FP examples:
An example of the Fibonacci series (Fibonacci) is usually used to illustrate the language syntax. Because functional programming languages are function-centric, is there any better way to demonstrate how to define them? You can regard the Fibonacci series and factorial as the Hello world of the function world.
Tubbie believes that FP is specialized in computing. Therefore, programmers who write databases or user interface applications do not need to use it at all:
FP supporters demonstrate computation examples because FP is good at this. The problem is that most programmers writeCodeIt is about interaction with databases, user interfaces, and does not contain complex mathematical operations orAlgorithm. FP is a very different language. If you only solve the boundary condition problem, you do not need to learn it.
Dooievriend agrees with tubbie:
...... I like functional language very much. It is very suitable for solving complicated computing problems ....... But I have no idea about using it to build a GUI and access a database. For me, FP is used only when complex and frequently changing problems occur, but it is embedded in other languages. This is the method in which the FP language should be used. At least I know that mercury is so used ......
Many people agree to the dooievriend statement. They believe that only imperative languages and functional languages can be used in combination.
There is no good explanation and example for functional language. Although Morton agrees, he does not think that FP is not popular:
...... I don't think FP is not popular. I often find that my colleagues use the function mode in the code, but they are not aware of it. It is also difficult to find a language that does not support FP. When both Java and. Net began to support the concept of FP, you are still worried that FP is not popular.
Alex said that he had used functional programming as a "secret weapon ":
You mean no one has written a convincing explanation of the benefits of function programming.Article? ...... My team and I have used f # To develop a stable, realistic, and commercial business application, which has been bought by large companies. The most successful part of functional programming is that the amount of code can be reduced by 4 to 10 times based on the features of the task. I am very confident about this, because we use F # To rewrite some old code, the written code is easier to maintain and expand. Therefore, it gives us a competitive advantage. Maybe we cannot convince most people that it is a good thing for us: we already have this secret weapon.
Original: http://www.infoq.com/cn/news/2009/03/fp-doesnt-catchon