jameydee: (Default)
2011-05-14 02:22 am

From Twitter 05-13-2011

  • 01:29:55: Belle is barking her fool head off, the caffeine & sugar have worn off, and the inevitable crash is here... #longdarkteatimeofthesoul
  • 19:59:05: RT @jessnevins: If I'm one of the 144K taken, would someone please run into my office and clear off my browser history? Don't look, thou ...

Tweets copied by twittinesis.com

jameydee: (Default)
2011-05-14 12:27 pm

Mild Programming Rant

So, I'm working on a module that exports output created by my company's webapp and creates a SCORM package that can be imported by a customer's proprietary desktop application.  Basically, this involves querying our database and creating XML trees and then saving out the trees.

So, we've basically done it.  Every on-line lesson created in our webapp is exported as an XML file compatible with the customer's app.  The last thing we need to tie it all together is the all important SCORM manifest file, which is an XML file that contains a list of the organization of the course and all the graphics and other media used by each course.

To me, the most logical thing to do is to create two XML objects.  On is for the overarching manifest file, the other is for the lesson we are processing at the moment.  All of the resources we are writing to the lesson XML file are going into the manifest file, so why not gather them while you read them.  Read once, write many, right?  Sure, we won't have all the info at the same time, but we can backfill as we get the info.

But my programming partner cannot accept this.  His first approach was to create an array to gather all this data.  He also rejected my idea of filling the XML object while we were reading the info for the other XML object.  Why?  Because it wasn't linear....but... HONEST TO GAWD! WHY USE AN ARRAY?  YOU'VE GOT THE MANIFEST OBJECT!!!  IT'S BETTER THAN AN ARRAY!  IT'S THE THING ITSELF.  There's ZERO reason to use an array in place of the XML object!

So he's waiting until all the files are created.  Then he's ***RE-opening the lesson XML files we just created***, traversing the XML lesson object in order to fill the manifest XML object,  and then writing the manifest.

On the modular side, I can see this.  On the efficiency side, WTF? 

I threw up my hands and said, "Okay.  Whatevah.  As long it works. Knock yourself out.  But you write it."