CodeSOD

Code Snippet Of the Day (CodeSOD) features interesting and usually incorrect code snippets taken from actual production code in a commercial and/or open source software projects.
« May 08

June 2008

Jul 08 »

Rigid XML Parsing

2008-06-30
Sure, we've chronicled horrible methods of storing data in XML, but what about when you want to retrieve said data? If you're into .NET, you're probably thinking of something in the System.Xml namespace. If you're a Ruby developer, you're probably thinking of REXML. If you're using PHP, the XML Parser extension. If you're a COBOL programmer, then you're probably praying for death.
When Michelle M. started her new job, she feared the worst, but hoped for the best. She'd be maintaing an app that had been around since the 1980s and made an impressive tour of technologies — from Clipper to VB to VB.NET and finally to C#. So I guess she didn't so much fear the worst as expect the worst.

A Dubious Honor

2008-06-20
"At my workplace, we have a wiki for the 'WLC' — the Worst Line Competition," Kirk writes. "We post lines of code that the lead developers have decided were good additions to the applications that we port. Here is one of the better ones:"
"A while back," Steven Victor wrote, "I was asked to look at an issue where numerical data 'kept getting more and more inaccurate' in newer versions of a software product."

wtflib.php

2008-06-05
"While updating on some delightfully unorganized PHP code (no indentation at all, split over hundreds of randomly named files, many included dozens of times), I kept running across comparisons such as:

More Randomer

2008-06-02
John B. saw some strange code that prompted him to investigate.
« May 08

June 2008

Jul 08 »