Although I've taken the rest of the year off, I wanted to share a few fun classics this week. "Because database drivers can be too complex" was originally published on 2004-07-09, and is just one of those WTFs you wish you could un-see...


I was pretty stoked to see this submission from Stian Søiland. We've all seen developers do all sorts of crazy things, from completely avoid regular expressions to not bothering to use INNER JOINs or even basic WHERE clauses. But this?!? I think takes the cake ... or at least comes pretty close ...

When asked to fix an application here at NTNU that lets students create their own mailinglists, I stumbled over this python script that tries to synchronize database entries with Mailman.

In addition to exploring how to create ugly code with Python, the author has discovered a way to avoid compiling a MySQL driver for Python - by using the "mysql" shell tool and parsing the output by splitting it by whitespace. (This will of course fail if anything resembling a space is present in the database)

Also notice the creation of mysql_cmds.txt for stuff to be executed by the SQL server.

(Debug messages and logging has been removed from the code)

 

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!