Lazy initializations
There are cases when you want to delay the creation of an instance of your object until its first usage. This technique is known as lazy initialization or lazy instantiation. The main purpose of lazy initialization is to boost performance and reduce your memory footprint. If instantiating an instance of your type carries a large computational cost and the program might end up not actually using it, you would want to delay or even avoid wasting CPU cycles. Imagine you are working on software for a health insurer.
For a customer, you will have a list of claims made. To get this list, you will need to go to the database and load the information. This is quite an expensive process and, if the user does not actually care about the information, it would be a waste of CPU cycles and memory. It is only when the user decides to list the claims that you will go and initialize the claims collection.
Of course, you can write your own code to handle initialization, but this work has...