http://www.perlmonks.org?node_id=280142

I've been doing a lot of database programming recently. In my most recent project I've run into two major problems. Each has led to at least an hour of lost time while I scratch my head at my seemingly flawless code failing on a simple, harmless operation. The first was an error in the DBD::mysql package that was reporting an error for the wrong statement and the second was a result of not closing statement handles and running out. Neither of these were obvious to me, and neither of them were giving any clear indication of where the error was.

I'm sure everyone here has had problems like this - but once the solution is found, where does it go? Aside from lurking in newsgroups - hoping for the question to pop up - how do you go about informing other people of your trials, errors, and eventual solutions?

Tutorials, FAQs, and man pages go a long way in teaching one to use a package, library, etc. But they are near useless when trying to debug a mystifying error:

  • Important items such as function prototypes are displayed prominently, whereas caveats are often at the end - or worse - buried at the end of a sentence (btw, don't do X and Y at the same time while using system Z). This makes it necessary to re-read large portions of documentation in search of answers.

  • It isn't always obvious where an error is originating. In my case, I couldn't tell from the logs whether the error was in my code, in the driver, in DBI, or in the database itself.

My proposed solution? A global "WTF" database, where all of the situations which cause you to shout out loud "WTF!" may be addressed. Anytime you have a problem, you can go to the database and type in search terms - or even just the error message you're receiving. Within seconds you have solutions from a hundred other people at your fingertips.

The biggest problem I see with this system is getting overcrowded - especially with issues that newer programmers may have but older ones take as a matter of course. Dividing the site into "beginner, novice, expert" would certainly help.

I dream of a future where you can simply type in error 329: unknown variable - resources gone and receive the helpful response Try calling cleanup() before using $PackageName::crazy_var.

Who knows - maybe, just maybe in the distant future, I'll think about implementation rather than just complaining here at PM.