Part III advanced programming techniques for F #

Source: Internet
Author: User

Part III advanced programming techniques for F #

In the second part, we discuss the common function concepts of most functional languages. It is now possible to say that functional programming, like reading encapsulation, inheritance, and polymorphism, is familiar with object-oriented programming, but to be an effective object-oriented developer, there are other things to learn, and there is no difference in functional programming with F #.

Just as each object-oriented language feature has its own features, there are some unique features in F # that are not normally found in other functional languages, and we see examples of this when we discuss the types and members of objects in the Nineth chapter. In the. NET world, F # is a class-one citizen (first-class citizen), able to use and declare standard. NET objects. We will see how to encapsulate the standard function code as an object, which is often the next step in the iterative development style. objects provide a better way to implement code structure and make it easier to use F # functions from C #.

We will also discuss best practices that are appropriate for functional F # code. In the tenth chapter, we will explore ways to optimize F # programs. Explains how to guard against stack overflow when recursion is used, providing techniques for improving program performance. In the 11th chapter, we will discuss refactoring (refactoring) and unit testing (unit testing), and now there are two approaches that are considered essential for almost any language or programming paradigm. In particular, we will see the impact of immutability on two areas.

In the 12th chapter, we'll discuss a better way to work with sequences and collections, and the concepts of lists (monads), which are the most cryptic terminology in programming languages, but they are actually less complex. In a sense, it is a design pattern that makes up the code with simpler fragments, so that the author of the list can specify additional aspects or behaviors that are added to the user-written fragments. We will see that we have been using this model, just not explicitly speaking out.

After reading this part of the book, it is generally possible to write efficient function programs and to take advantage of a variety of F # specific language features. We'll learn how to use functional programming on the. NET platform, including the ability to combine functional, object-oriented, and command styles, and be able to write and test code using standard techniques. After reading this section, you can successfully find a job as an F # programmer, and we certainly don't recommend skipping the fourth part, which provides examples that combine all the functional techniques discussed in this book.

Part III advanced programming techniques for F #

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.