Why is functional programming not popular?

Source: Internet
Author: User

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 programmers who write applications, functional programming is still unfamiliar and far away. Confusion initiated a big discussion on tweakblog.net about why functional programming languages are not popular.

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 the majority of the code written by most programmers every day is about interaction with databases, user interfaces, and so on, and does not contain complex mathematical operations or algorithms. 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 (ffunctional programming ages) can be used to achieve the best of both worlds.

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 ":

Do you mean that no one has written a convincing article about the benefits of function programming? ...... 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.

Although everyone has different opinions, one thing we can tell is that functional programming has obvious advantages and advantages. Have you used functional languages? What do you have to say about functional programming? For more information about function programming, visit the function programming topic on the infoq Chinese website.

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.