Fancy Custom Generators

Learn about complex custom generators and the methods that are used to implement them.

Now that we’ve looked at the techniques of basic custom generators, it’s time we make things slightly more complicated and start learning how to work with fancy custom generators.

Purpose of fancy custom generators

We can get pretty far with basic custom generators, but there are cases where they won’t be enough to solve our problems. That is when we’ll require more advanced techniques in our custom generators.

Let’s take a look at how we can make use of the basic techniques to write recursive generators and symbolic calls.

Symbolic calls are a technique that makes the complex generators more understandable when the properties fail.

Recursive generators

Whenever a piece of data can be represented by a repetitive or well-ordered structure, or when a step-by-step approach can be used to create the data, recursion is our friend.

In the next lesson let’s look at how generator recursion works.

Get hands-on with 1200+ tech skills courses.