--

The ALERT SELECT problem is that it doesn’t leave any fingerprints. If you’re debugging code and you’re not looking from the very start of the program, you don’t know what might have changed.

I think developers who use On Error Resume Next probably assume they’re getting a behavior like empty catch blocks (just run the program and don’t tell me if there’s a problem!) But the exact equivalent to On Error Resume Next would be a separate empty catch block around every single statement. So empty catch blocks are definitely an antipattern because you’re swallowing errors indiscriminately, but only On Error Resume Next will keep going line-by-line on the same task. It’s empty catch blocks on steroids.

--

--

Matthew MacDonald
Matthew MacDonald

Written by Matthew MacDonald

Teacher, coder, long-ago Microsoft MVP. Author of heavy books. Join Young Coder for a creative take on science and technology. Queries: matthew@prosetech.com

Responses (1)