I Should Have Been a Firefighter

Primitive Man, Primitive Code

This is the scene:

The database lives at the top of a tall hill surrounded by a moat filled with monsters and dragons. As you climb the hill you fight off soldiers armed with crossbows, swords, and tight security packages. The database is inside a castle, and any attempt to breach the castle wall is met with vehement resistance; dragons and carnivorous plants block the way. When you get through the door, a powerful wizard demands that you answer three questions correctly and perform a heroic task before he allows entry. "What is the user name? What is the password? What is the global alias? Now you must slay the mightiest ogre in the land."

When you have answered the questions properly and slain the ogre, the wizard tells you, "Very well, you have been granted access to the wisdom of the database. But you must approach only along this path. Stray off the path, and your code will crash, and there will be much woe within the company."

Let’s assume for a moment that your horse actually can make it along the path. You reach the database, and you ask your question: "Oh, wise database, please select all of the users who have registered with us over the weekend."

The database replies, "kasdhf293847i1 09384rv hkqsdf".

The database is wise, you see.

This is why it’s called an Oracle.

But let’s get back to that horse. And let’s call it, "Perpetual Horse Perambulating", or "PHP" for short. The problem here is that given the paths that the powerful wizard (known as the DBA, just for the heck of it) has defined are not compatible with the horse. In other words: we PHP developers were told that in order to make this project work on our new platform, we must rewrite the PHP code in order to work with the Oracle database through certain restrictions that he (in consultation with the platform engineer — another type of wizard, somewhat akin to a wizened alchemist) has defined. Simple INSERT and DELETE commands aren’t good enough for our database. It insists on blocks of customized insertion code called "primitives".

The Oracle is a finicky Oracle.

Unfortunately, PHP isn’t set up to talk to these primitives. So we need to hack at PHP a bit and make it work. Shorten the legs a bit; lengthen the tail; dye the mane; chop off its head and replace it with a tiger’s head. But that involves messing around with source code that the other PHP developer and I are just uncomfortable touching.

I have this vague memory of my first job ever, working for a large aerospace company, building a little program (in a commercial product which is still around, though it’s no longer the Big Kid On The Block, the way that it used to be) to make the database talk to these punch cards that the Navy insisted were the most efficient means of communication. Things were easy back then. Or, at least, easier. When I sized the project at taking six weeks, the manager was annoyed. When I announced that it was ultimately impossible since the Navy was sending us sixty-seven essential bits of data and the database could only take sixty-four, I found myself shunted off rather quickly to a new department. Back then there was no Oracle, there was no PHP, there was no web. Things were simpler.

And my mind wanders back to even more ancient days. What were things like in the caveman days? Did Og say to Ooog, "Club no longer work, not compatible with newer model mastadon. Fod."? And did Ooog reply, "New mastadon crash today, kill three hunters. Double fod."? Of course they did. Some things just never change.

So here I sit in Portland once again (helpful note: when your manager says, "This is your last week traveling out of state", what they really mean is, "You’ll have at least two more weeks of this"), with Og and Ooog, trying to pound PHP into understanding primitives so it can talk to the Oracle database. Well, pulling information out of the database is easy; but putting information into it is a bear. In a meeting we had with the DBA, the DBA explained his proposed schema to us, and it made us queasy. Then the DBA chuckled, "I sure don’t envy you guys. Maybe we’ll just give up on PHP and seek out a Perl solution."

In general, I like this web programming thing. I love building databases and making websites that talk to them. But there are times when I feel like grabbing Og’s Club 2.01b and pounding the hell out of my computer…