Stupid Coder Trick of the Day

calendar Posted on October 21, 2006   comments No Comments

I should start a weekly feature on this topic… lord knows, while I like to think I write decent code I also have a knack for pulling some real bone-headed stunts.

Today’s stunt: Suppose you have the result set from a query fetching a list of email addresses. Your program needs to go through the list and send informational emails about an action that has just occurred.

Suppose you forget to increment your counter as you loop through that result set?

Oy Vey. Of course, the first address in that list was my “testing” address at gmail. Took me 15 seconds to realize what I’d done. In the time it took to realize and kill it, I think over 1k emails were sent to it! [Updated: Over 6000 emails were generated!] [Updatedx2: I just deleted another 5k out of the outbound queue on the mail server.  Holy Crap!]

Hope my employer isn’t black-listed for this…

tags Tags: , ,

Related Posts Possibly Related Posts

Comments

Leave a Reply




Have you read the Comments section on the Disclaimer page?

About

Wandering the Internet, looking at all things bright and shiny. Playing with many, writing about some. More …

Recent Posts

Recent Comments: