Recent Articles

28 Aug 2015

Political Errors

by Mark Bowytz in Error'd on 2015-08-28

"I agree, Google. When it comes to news coverage of politically sensitive topics, many errors have occurred," writes Scott.

37 Comments - Last Comment @ 07:22
27 Aug 2015
26 Aug 2015

A Fever on a Crappy Day

by Remy Porter in Bring Your Own Code on 2015-08-26

It feels like forever ago, we introduced the Lucky Deuce casino contest. This is a series of challenges, brought to you by our pals over at Infragistics, where we call on you to help us build a “scoundrel’s casino”. We are nearing the end of this little BYOC contest- this week is our last "all original" round, and next week, we'll introduce one final challenge that leverages code you may have already written for this contest.

Last week, you had a tricky little problem: you needed to write some code that looked like it was going to cheat, but really would get the cheater caught.

41 Comments - Last Comment @ 2015-08-27
25 Aug 2015

Foxy Checksum

by Remy Porter in CodeSOD on 2015-08-25

Pavel D inherited some… we’ll call it “software”… that helps run warehouse operations for a boiler/heating manufacturer. That software was a Visual FoxPro database.

Now, this application needs to read barcodes off of products in the warehouse. Since the laser-scanners can sometimes mis-read those barcodes, the database uses a custom check-sum algorithm.

57 Comments - Last Comment @ 2015-08-28
24 Aug 2015
21 Aug 2015

Nil, null, nihilism

by Mark Bowytz in Error'd on 2015-08-21

"Figures. A suggestion devoid of meaning," writes Blake R..

67 Comments - Last Comment @ 2015-08-24
20 Aug 2015
19 Aug 2015

The Lucky Deuce: In the Cards

by Remy Porter in Bring Your Own Code on 2015-08-19

Two weeks back, we introduced the Lucky Deuce casino contest. This is a series of challenges, brought to you by our pals over at Infragistics, where we call on you to help us build a “scoundrel’s casino”.

Last Week, you were again given some vague requirements, this time for building a broken slot machine. Once again, we had some seriously great submissions. Like last week, I’ve rehosted the winning code here.

Honorable Mentions

21 Comments - Last Comment @ 2015-08-20
18 Aug 2015

At Least There's Tests

by Remy Porter in CodeSOD on 2015-08-18

Having automated tests for a project is a good thing, as a general rule. We can debate the broader merits of “TDD”, “ATDD”, “BDD”, “ATBDDSM”, how much test coverage is actually worth having, and if we should view our test approach as a series of metrics that must be met, instead of some guidelines that will help improve our development process.

Our first exhibit today is from Paul. It’s a JUnit test, that, well, maybe misses the point of writing unit tests:

39 Comments - Last Comment @ 2015-08-19
17 Aug 2015
14 Aug 2015

Are You Using?

by Mark Bowytz in Error'd on 2015-08-14

"No! Never! Absolutely not!...Well, OK, back in college. Just once," writes Jack R..

137 Comments - Last Comment @ 2015-08-24
13 Aug 2015
12 Aug 2015

The Lucky Deuce: Getting in the Slot

by Remy Porter in Bring Your Own Code on 2015-08-12

Last week, we introduced the Lucky Deuce casino contest. This is a series of challenges, brought to you by our pals over at Infragistics, where we call on you to help us build a “scoundrel’s casino”.

Last week’s challenge was to build a “broken” roulette wheel, that instead of being truly random, avoids recently spun numbers to “feel” more random. I’ve rehosted all of the winners’ code here.

Honorable Mentions

20 Comments - Last Comment @ 2015-08-17
11 Aug 2015

Count On It

by Jane Bailey in CodeSOD on 2015-08-11

“Duct-tape

If there's one thing more exhausting and ridiculously over-complicated than moving house, it's moving legacy apps. Something as simple as a migration to another, identically configured (in theory) server can cause unexplained breakages and weird glitches in bits of the code no current staff member has ever touched.

72 Comments - Last Comment @ 2015-08-24
10 Aug 2015
07 Aug 2015

Piles of Unsanitized Clothes

by Mark Bowytz in Error'd on 2015-08-07

"I'm not sure if the WTF is that I have to find 0000FF]2 piles of dirty clothes," Simon H. writes, "or the fact that the ']' makes it look like they entered the information in something resembling BBCODE."

66 Comments - Last Comment @ 2015-08-11
06 Aug 2015

Listicle

by Remy Porter in CodeSOD on 2015-08-06

The Top 10 Ways to See if an Item Is in a List, Only 90s Kids Will Get this

Pardon the clickbait headline. We’re only going to look at one method to tell if an item is in a list. A bad one.

Andrew M. inherited some software that tracks metrics. There are three general categories of metrics- “MS”, “FN”, and “CM”. Each of these categories contains a number of specific metrics, each assigned its own ID.

212 Comments - Last Comment @ 2015-08-25
05 Aug 2015

Introducing the Lucky Deuce

by Remy Porter in Bring Your Own Code on 2015-08-05

The life of a developer is about being cunning. When presented a problem that could be solved with strenuous, character-building labor, our first instinct is to automate it and cheat our way around it, if at all possible.

Or maybe I’m just projecting. Still, if there’s one thing I’ve noticed, TDWTF readers are a shifty lot of scoundrels. It’s time for us to put that cunning to work.

115 Comments - Last Comment @ 2015-08-11
04 Aug 2015
03 Aug 2015

Save Yourselves!

by Dan J. in CodeSOD on 2015-08-03

Scott K was cleaning up a configuration utility used by his team when he dredged up this sanity-threatening artifact:

void Save(string path)
{  
    XmlTextWriter write = null;  
    try
    {  
        write = new XmlTextWriter(path, null);
    }  
    catch (IOException)
    {  
        write.WriteEndDocument();  
        write.Close();  
        try
        {
            write = new XmlTextWriter(path, null);
        }  
        catch (IOException)
        {
            return;
        }
    }  
 // Write stuff to the file
}  

19 Comments - Last Comment @ 2015-08-03