Of course, some of you figured this out. This usually happens when programmers get too much OO and forget about performance and have a database.
As an example, let's say that we have an email table and they must be sent by this program. At startup, it searches for everything that needs to be sent as follows:
Emails = find_every_damn_email_in_the_database();
FOR Email in Emails
IF !Email.IsSent() THEN Email.Send()
This is good in terms of do-not-repeat-yourself, but sometimes it is inevitable, and it should be:
Emails = find_unsent_emails();
FOR Email in Emails
Email.Send()
Is there a name for this?
source
share