Code monkey

The reason there haven't been any posts lately is due to two factors. Things being relatively quiet at work, and me banding on a programming problem. The previous post shows the begining of it.

What I was trying to do was to parse in the XML contained in "dirinfo.xml" on the _admin volume for specific servers, and dump the data into a database. I had the perl working for two days, but somewhere I irretrievably broke it in a way that resisted all efforts of finding the problem. Setting the DBI to max-debug, I noticed that the hang happened in the middle of two bind_param requests. Since the perl debugger won't step into calls like "$sql->bind_param(1, holyGroats);" I couldn't tell where the problem was dying. I ultimately gave up.

So I've been spending the last three days attempting the same thing in C#.Net instead. This was done under the presumption that if I went end-to-end with Microsoft products, it might work better. So far, that's holding true. Right now I have C# code that'll duplicate what I was doing with the perl script. This code is about twice as long as the perl code thanks to the level of exception-handling I have to throw in, and having to work in a strongly-typed language instead of a loosely-typed language.

The biggest stumbling blocks was figuring out how to parse in the XML and manipulate it. In perl this was very easy, and took me about 35 minutes to figure out. In C#, XML parsing is about as complex as, say, Perl regex syntax, and about as powerful. In other words, I was drowing in options. It took two days to figure out how to get at the data I need, and I'm very sure that it isn't done 'correctly' for what I am doing. If Novell ever changes the format of this XML file this program will break hard. The fact that object-oriented programming makes my brain leak out my ears didn't help any either.

I don't program for a living, and it shows.

Now to start commenting like a madman.