...

/

Introducing Lazy Evaluation and Proxy Objects

Introducing Lazy Evaluation and Proxy Objects

Learn how lazy evaluation differs from eager evaluation and how to use proxy objects.

We'll cover the following...

First and foremost, the techniques used in this chapter are used to hide optimizations in a library from the user of that library. This is useful because exposing every single optimization technique as a separate function requires a lot of attention and education from the library user. It also bloats the code base with many specific functions, making it hard to read and understand. By using proxy objects, we can achieve optimizations under the hood; the resultant code is both optimized and readable.

Lazy vs. eager evaluation

Lazy evaluation is a technique used ...