Chapter 8. Optimizing the Code using Laziness and Caching Techniques

We discussed recursion, which help us to iterate sequences easily, in the previous chapter. Furthermore, we need to discuss about optimizing code since it is an essential technique if we want to develop a good program. In a functional approach, we can use laziness and caching techniques to make our code efficient so that it will run faster. By discussing laziness and caching techniques, we will be able to develop efficient code. To learn more about laziness and caching techniques, in this chapter, we will discuss the following topics:

  • Implementing laziness in our code: lazy enumeration, lazy evaluation, nonstrict evaluation, and lazy initialization
  • The benefit of being lazy
  • Caching ...

Get Functional C# now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.