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 #