Remy Porter

Computers were a mistake, which is why I'm trying to shoot them into space. Editor-in-Chief for TDWTF.

Jul 2016

Exit Thread

by in CodeSOD on

Objects left in the garage or the attic tend to multiply. If you don’t clean them regularly, you find mysterious and inexplicable things have bred like rabbits. “Why is there a bag of marbles in this box, and when did I ever buy an ugly Christmas sweater?”

Without regular refactoring, the same thing can happen to your code-base. Michal is finally taking a look at a bit of code that hasn’t been touched since 2001. The original developer has left the company, there’s no documentation, and the SVN history has long since been discarded.


The Keys to Cloud Storage

by in Feature Articles on

When you want to store data in Amazon’s S3 cloud-based storage, you have to assign that data a key. In practice, this looks and behaves like a filename, but the underlying APIs treat it like a key/value store, where the value can be a large data object.

S3 is flexible and cost-effective enough that Melinda’s company decided to use it for logging HTTP requests to their application. These requests often contained large data files for upload, and those files might need to be referenced in the future, so a persistent and reliable storage was important.


OhgodnoSQL

by in CodeSOD on

How about those NoSQL databases, huh? There’s nothing more trendy than a NoSQL database, and while they lack many of the features that make a traditional RDBMS desirable (like, um… guaranteeing writes?) , they compensate by being more scalable and easier to integrate into an application.

Chuck D’s company made a big deal out of migrating their data to a more “modern”, “JSON-based” solution. Chuck wasn’t involved in that project, but after the result went live, he got roped in to diagnose a problem: the migration of data from the old to the new database created duplicate records. Many duplicates. So he took a look at the migration script, and found piles of code that looked like this:


Lunatic Schema-tic

by in CodeSOD on

One day, James’s boss asked him to take a look at a ticket regarding the “Cash Card Lookup” package, which had an issue. James had no idea what that was, so he asked.

“I don’t know,” his boss replied. “I just know the call center uses it. You’ll need to talk to them.”


Hanging By a String

by in CodeSOD on

We all know that truth is a flexible thing, that strict binaries of true and false are not enough.

Dana’s co-worker knew this, and so that co-worker didn’t use any pidling boolean values, no enums. They could do one better.


Independence Day

by in Feature Articles on

Today is the 4th of July, which is a holiday with historical significance in the US. Twenty years ago, Jeff Goldblum and the Fresh Prince defeated an alien invasion using a PowerBook and a hastily written computer virus. It’s such a big holiday, they’ve just released a mediocre and forgettable film about it.