DEV Community

Cover image for Harnessing the power of laziness in software development
Gerardo Antonio Gerónimo Vasconcelos
Gerardo Antonio Gerónimo Vasconcelos

Posted on

Harnessing the power of laziness in software development

You are at a buffet dinner, with a plate in your hand and a table full of delicious dishes. Would you choose to bring to your table everything you can carry, or would you simply take a small portion and come back for more if you wish?

If you chose the second option, Great! You're like Sid (a little reference to Ice Age) But don't worry, the truth is that in software development this is a widely accepted and beneficial strategy.

In this context, we refer to a couple of techniques known as lazy evaluation or lazy loading, which are ways to use resources efficiently.

Lazy evaluation

You don't throw all the meat on the grill at once, you better wait for the diners to request it.

In technical terms, lazy evaluation consists of postponing the evaluation of an expression until the results are needed, similar to an on-demand service.

Lazy loading

This technique is very similar to the previous one, but in this case, the creation or initialization of objects is delayed.

If an event starts at 6 in the evening, there is no reason for you to start getting ready at 6 in the morning.


In summary, being "lazy" in software development involves making smart decisions about how and when to use resources, avoiding unnecessary expenses and optimizing performance. It is a strategy that can lead to more efficient code and better use of available resources.

As in our life, it is completely valid to avoid unnecessary efforts in order to concentrate our physical and mental resources on those tasks that really interest us.

Top comments (0)