How do you connect to and converse with your database of choice (MySQL, in my case)? Chances are it’s largely formed by the programming language you choose. I’ve worked with a variety of programming languages. Anytime I begin learning a new one, I am reminded again that there’s more than one way to skin a cat.
Over the last few years, I’ve mostly programmed in Perl and
shell. The shell interface to MySQL is simple: the
mysql command-line tool. There is not much to think
about. In Perl, however, the standard is to use DBI. I have grown
accustomed to DBI over the years, but that doesn’t mean I like
it. I think it’s one of the worst database APIs I’ve seen. The
abstractions it uses (there are only two object abstractions:
connections and “statement handles”) are awkward to the extreme.
It does get worse, though. PHP historically used libmysql’s C library for connecting to MySQL, and similarly used native …
[Read more]