How to Recognize the Antipattern
Though you might think that the absence of code is by nature difficult to spot, many modern IDE products highlight instances in your code where you ignore a return value from a function that returns one or where your code calls a function but neglects to handle a checked exception.[30] You could also encounter the See No Evil antipattern if you hear phrases like the following:
-
“My program crashes after I query the database.”
Often the crash happens because your query failed, and you tried to use the result in an illegal manner, such as calling a method on a nonobject or dereferencing a null pointer.
-
“Can you help me find my SQL error? Here’s my code…”
First, start by looking at the SQL, not the code that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access