Andy @ Work

Monday, September 25, 2006

WTF?

My company has recently signed a maintenance agreement for a web system written by a third party software company. This third party is based in Queensland are doing quite well for themselves.

The code is strange at best, and in some places just downright confusing.....but today I came across this little pearler:


child = xml.CreateElement("creditFlag");
child.InnerText = false ? "yes" : "no";
element.AppendChild(child);


The problem is, it didn't just show up once but in a few places, sometimes with the conditional hardcoded to true instead of true. WTF?

As a side note, I tried to post this snippet to The Daily WTF but I just couldn't work out how to submit something to them. Maybe they don't take public submissions or something.