What is the name of this anti-pattern?

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?

+5
source share
13 answers

I will go to him and put on the name "lazy filter (anti) template".

+9
source

. .

"firehose"

+5

Joel Spolsky .

-, , , , Active Record.

+2

" ".

+2

, , (, , ).

, , , . , , , "" .

, , , , , , .

+1

-:

, , find_unsent_emails(), "". , ?

+1

, , SQL-. , , , , , , , ORM, , .

, "Easy Way Out" (). . , , . , , .

+1

, " " " " " " " ", , .

.

+1

Stoopid.

, . , " ", .
0

, Emails. ( std::vector::begin() C++), , - .

0

.

  • "I don't know-SQL" antipattern
  • Antifatter "Fascist-DBA"
  • "What does 'latency' mean?" antipattern
0
source

There is a good example in The Daily WTF .

0
source

Partially inspired by the 1800's “lazy filter (anti) pattern”, how about “dysfunctional programming” (ie the opposite of functional programming)?

0
source

All Articles