« Jul 14

August 2014


Issue History

Ladies and gentlemen: the story you are about to read is true. Only the names have been changed to protect the innocent. The guilty are too obtuse to recognize themselves in the story, even if their names hadn't been changed.
When Simon asked us to consider this code from his predecessor's custom-built PHP CMS, we weren't terribly impressed:
Part of what brought me into writing and editing for The Daily WTF was my love of telling stories. I’ve had a very successful career working inside of corporate IT shops, and a huge part of that success comes from my ability to take a complex technical topic and explain it simply. To do that, I fall back on the same storytelling techniques that I use here.

The Data Migration

Consider a small European country with more than 20 social insurance institutions, each using their own proprietary software. Now consider sharing data between them. After decades of integration failures, these institutions decided to standardize on a handful of applications. One of these institutions hired Philipp’s firm to migrate their data to DB2. Philipp’s boss gave him the assignment with a clear conscience. “They have a data transfer interface already established. This should be a quick process.”
When developers first got access to those new-fangled gadgets called computers, memory was a very precious resource. Applications were frequently written as a main controller that would load module overlays into memory, call a function, and then repeat as additional functions were called. It was a horrible way to code, but it was all we had. Unfortunately, as computers came equipped with more and more RAM, this habit of repeating the controller code in every file seems to be quite resilient...


"I'm kind of surprised to see these kinds of positive ratings for soundtracks that may or may not exist," writes Bobby S.
Jeremy’s employer, SwissMedia, were upgrading their proprietary CMS to run on new, shiny, PHP5. They planned for bumps in the road, but assembled a rugged upgrade plan with a steel chassis. When the time came to upgrade their largest client, French-Haitian News, Jeremy was behind the wheel.
States and their abbreviations are among my favorite kinds of data - they almost never ever change and, as such, you can hard code all that information into your app. I mean, why bother fetching it from the database every page load? That's just wasted CPU cycles.


In life, you will inherit all sorts of things: traits from your direct ancestors, knick-knacks from relatives you tolerated, and sometimes, even money! Of course, there are other things in life that you inherit that you might not even want. The gene for some debilitating disease. The urn filled with the ashes of a relative you particularly despised. Code.

The Constant Bomb

On one hand, this Java class Jim found is just another instance where somebody made constants like this:
Rob wrote, "I was trying to raise a service request for an Office 365 issue but the service request functionality was broken. I could of course try and report this... by raising a service request."

Securing Input

We all know that many developers have difficulty in dealing with built-in concepts like dates and times, and that for and switch statements don't necessarily have to be used with each other. However, validating a piece of input is usually more straightforward. You compare what you got to what was expected.
While working on his company's reservation manager, Stephaan stumbled upon some PHP code that calculated the date values for tomorrow ($morgen) and the day after tomorrow ($ubermorgen). Something about the code struck him as ... wrong.

Nuclear Internship

Before he could graduate, Grigori’s Russian university program required him to complete a large-scale, real-world project. Like most of his peers, he planned to use this as an opportunity for job experience, which meant partnering with an outside company. Since Grigori did low-level development and microelectronic engineering, he found a paid internship position with the Russian Automation Institute. RAI has one major client: the company responsible for managing Russia’s nuclear reactors and supply parts for nuclear weapons.

Literal Scripting

The HR team at Initrode were a happy bunch, casting their nets into the perpetual stream of eager undergrads from nearby WTF U. It was a summer tradition at Initrode to invite a school of juniors to get a taste of their future by spending the long, sun-drenched afternoons of their dwindling youth hunched in cubicles.

Welcome to Word!

"The first time I started up Word 2013, it offered to give me a tour. Upon reflection, this probably is a pretty accurate tour," writes Matt M..
The question of whether you should include in-line comments in your code is a running one in the development community. To some, they are part of the process of ensuring the ongoing maintainability of a codebase. To others, comments are the spawn of satan, lower than cockroach droppings, or slightly above a Justin Bieber song.
99% of terrible emails are just that. Horrible. However, there's that glimmering 1% of terrible emails that are so bad that they end up being pretty good. Here are a few of them. And, as always, remember - send us your (best) worst emails. We love them!

Don't Speak

“Are you Greg?” asked the burly man with a scar from eyebrow to chin. “I’m Mark, your manager.”
We've all heard of threads. No, not the stuff hanging loosely from your clothes. I mean threads, as in multitasking. Most modern languages have all sorts of nifty facilities that allow you to create, manipulate and destroy them at will and with minimal effort. There are even abstractions that will manage a set of threads for you, so that you can spawn a bunch of tasks, and let them tell you when they're done. You can synchronize them yourself. You can put up cyclic barriers to make them all wait at a specific point in the code. You can make them return a value when they're done. Or you can just spawn them and let them run all by their lonesome. Of course, not everyone trusts the built-in facilities... Now you might expect this sort of thing from Joe Offshore, but not from certain huge, blue companies.
"Wow! The IEEE takes privacy so seriously that they redacted the entire table of contents!" Jeremy R. wrote.
« Jul 14

August 2014