Jul. 2nd, 2015

XML Hell

Jul. 2nd, 2015 04:43 pm
billroper: (Default)
I came to one of our projects here at work rather late in the game, as I'd been off working on something else (a complete rewrite of our Server locking) for a long time. The new project required extensive writing and parsing of XML.

Now, I am a lazy programmer. My first thought when I saw all the decoration that had to be done in order to get standard XML written out was "This is a good job for a simple set of methods that will handle all the silly formatting." That way, you only have to get the formatting right once and the method will do it for you in the future. It not only makes it easier to write the code, but it makes it more maintainable.

When I introduced my little function library, one of the other fellows in the group allowed as to how he thought that was a silly idea, because it was easier to just write all those little opening and closing tags by hand.

OK. YMMV.

Well, we had a bug come in last week and it got punted to me.

It turns out that someone (I don't know which of the guys) had some fine hand-coded XML for sending a formula string down the pipe. In fact, we send that XML in three different places in the code, all coded completely de novo, because why would we want to write a method instead of retyping all this damned string concatenation?

It also turns out that only one of the three places correctly encoded the formula string so that it would be passed correctly if it contained annoying things like quotation marks. Oops.

Well, that would explain the bug...

*thud* *thud* *thud*

Profile

billroper: (Default)
billroper

May 2025

S M T W T F S
     1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28293031

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 28th, 2025 09:12 pm
Powered by Dreamwidth Studios