Functional Programming (F #) personal sense

Source: Internet
Author: User

Function programming has long been available, not only F #. But F # makes me really understand and use functional programming.

I remember that at GE, I felt deeply that a large company plays an important role in technological development. Of course this is a digress.


I used to take a casual look after a meal, but recently I used it myself and found some misunderstandings.

Update as you write.


1. I personally think that functional programming (FOP) is actually two parts: data and process.

Although both are defined in a let, they are actually opposite and unified.

This is different from Object-Oriented Programming (OOP. Oop also unifies the two, but includes the object concept.

Functional programming is different, and the distinction between them is obvious.

Once defined, a function can always be used without initialization. This is just a "process.

In addition, matching match, pipeline |>,<|, and combination <<>> enables these processes to link up and look like a flowing river, allowing data to flow, very clear.

While OOP makesProgramIt looks more like an automatic machine, and WPF data binding is a classic.

It is precisely because of the emphasis on the concept of "process" that function programming has a great advantage in multi-core applications.


2. functions can be defined internally.

Oop is not acceptable!


3. variable or sub-reference and value types.

This is a classic DOTNET type.

Ref,: =, And! are used for reference types ,! Keywords

Use of value types <-

4. the C # Delegate needs to be converted in F.

5. It is recommended that the parameters and return types for beginners be fully written. do not enable the compiler to automatically reason.

Otherwise, you often do not know where your mistakes are.

6. Lop has no command language, such as break, continue, return, and Goto.

Lop processes data in blocks, such as vector, matrix, list, seq, and array.

Therefore, I personally think lop should use much larger memory than programs written in other languages.

7. Lop is indeed suitable for writingAlgorithm(Program Logic ).

In the past, only flowcharts were used to write algorithms and modify algorithms.CodeI am bored with writing a lot of braces and function definitions.

F # is different. In recent several processes, F # is used to write on the manuscript, which is very clear. Basically, it is the final code. In the past, we used the pseudocode writing process. We used C ++ and C # To write it in vs. We have to deal with it.

8

Match cross (p1.topoint2d () (p2.topoint2d () (HD. topoint2d () (TL. Head. topoint2d ()


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.