Recent Articles

Feb 2012

DATE_NOT_FOUND

by in CodeSOD on

So it’s once again February 29... that one time every four years when newspapers do their fluff pieces about people who only have a birthday every four years, and you find all kinds of obscure bugs in your code. I managed to save two examples from the last leap day that I thought would be best shared today.

The first is from Eric, who wrote "my client is an alcohol company, and I run their website. They have a members-only section of their site that requires that you to enter your birthdate. If you're less than 21 years old, they kick you out and won't let you onto the site until you come back on and lie about your date-of-birth."


Database Changes Done Right

by in Alex's Soapbox on

Throughout my software development career, I’ve seen my fair share of debates over how databases should be developed. And like most disagreements over technical pedantry, the participants are generally well-intentioned but grossly inexperienced. So much so that it wouldn’t matter if they use foreign keys or not. Though “elegant”, their software will become an unmaintainable mess after a few short years. But regardless, one counter-argument that constantly rears its ugly head goes something like, “but what if we have to change it later?”

In other debates, that question can be quickly rebutted with “uh, we just change it then,” but when the discussion is on databases, it actually holds water. It’s as if the database is a marble statue that, once shipped to production, should never be changed... and if it must, there had better be a damn good reason.


The Regex Code Review

by in CodeSOD on

Ding! A new e-mail appeared in Jed's and the other developers' inboxes on the floor. It was from his coworker Bob, and it read:

"Jed, the term-validation process of CAPBACS is a performance bottleneck that's costing our company thousands in lost sales every month. This change must go in ASAP. While I appreciate your feedback and input, I don't believe that your experience working on the Web places you in a position to critique my work. Thanks!"


Sponsor Appreciation, High Tech in Arkansas, License to Enumerate, and More

by in Feature Articles on

We've got some great companies that sponsor The Daily WTF. And all they ask in return... just take a moment or two to check out what they do. It's some pretty cool stuff.

TDWTF Sponsors

Singlehop Logo   SingleHop - SingleHop Dynamic Servers combine the flexibility of Cloud Hosting with the private resources of a Dedicated Server. The best of both worlds. Try today for 50% off 1st month. Deployed in 1 hour. Try it today with coupon code "BOOM".
New Relic   New Relic is basically a magical, real-time performance and user monitoring tool that works on virtually any web platform: Java, Ruby, PHP, .net, Python, Ruby on Rails. I'm not sure how it works (magic?), but it's incredibly easy to use and is pretty inexpensive.
New Relic   Monetate - their testing, targeting and personalization platform for online retailers is used on leading websites like Best Buy, Sports Authority and Urban Outfitters. If you’re a problem-solver who is passionate about rich web applications, scaling Internet applications to billions of page views, and working with big data, then you’re a perfect fit for our close-knit and agile team.!
Inedo   Inedo - the makers of BuildMaster, the free, and easy-to-use, web-based deployment and release management tool. Going far beyond Continuous Integration and into Continous Delivery, BuildMaster delivers a series of robust features unparalleled by other build-promote-deploy-distribute tools. They're also behind the upcoming ProGet, a NuGet package repository that lets you host and manage your own personal or enterprise-wide NuGet feeds.
Singlehop Logo   Amazon DynamoDB - is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. With a few clicks in the AWS Management Console, you can launch a new Amazon DynamoDB database table, scale up or down request capacity for the table without downtime or performance degradation, and gain visibility into resource utilization and performance metrics.

And now for something completely off-topic...



The Phony

by in CodeSOD on

"My first impression of my predecessor was a positive one," writes Michal Ochman, "he was well-spoken, sharply dressed, and seemed to be an all-around nice guy."

"My first impression of my predecessor's code was also positive — it was sanely structured, well-commented, and all-around seemed pretty clean. And then I started actually looking through it. It was filled with a lot of... well... this."


Steve's Email

by in Feature Articles on

For a ramen-fueled college student, a job offer that actually involves doing the work you're in school to learn and has a paycheck that can't be beat flipping burgers is a wonderful score. For Ted, that score came from a company run by alumni from his school that gave out pretty plum gigs to top students.

They were a support company, that contracted out to run the IT infrastructure for other companies. While the support company actually cut Ted's check, they were a small company. 90% of their business came from a single customer, the PubCong publishing conglomerate. It was for PubCong that Ted would be actually working.


The Sentimental Query

by in CodeSOD on

After weeks, months, or even years of setting up and preparing to sell, it’s always exciting to get those few customers. Depending on the venture, it may not be worth popping open a bottle of Champagne, but no matter how small the sale, one can’t help but take a few moments to pause and smile before struggling to get that next batch of sales.

By the time the 13,853rd customer rolls around, no one blinks an eye. It’s just business as usual. That is, unless you work at Ruben’s company. When a new customer record is created, their server not only takes a moment to celebrate, but it nearly brings down the entire server with this unique way of finding the next available customer number:


Departing in 9999 Minutes

by in Error'd on

  Wout van Poppel remarked, "Yesterday's newspaper didn't really contain any interesting news, but at least the photo captions were interesting."


The Lemming Switch

by in CodeSOD on

"The way in which project requirements meet developers at our company is a WTF in and of itself," writes Kevin, "but suffice it to say that a certain developer was tasked with writing a Windows Service that would periodically review a list of files from the network and purge them if necessary."

"Of course, to this certain developer, 'Windows Service' means something that is left running on a desktop somewhere. In his world, VB6 is also a 'simpler, cleaner, and easier to use' platform, and thus is his platform of choice... to this day. Here's what he delivered after a couple days of work."


I've Got Your Number

by in Feature Articles on

"The system is down!" cried the voice at the end of the phone. "We've run out of numbers!"

"You've… run out of numbers?" asked Daryl.


The Applet Redirect

by in CodeSOD on

"One of our sites is partially maintained by a third-party vendor with developers based out of Kerbleckistan," writes Nathan, "they'll sometimes 'forget' to use version control and instead just write directly to production. This has naturally caused some frustrating 'lost feature' problems when they remember to use source control, and somehow this all falls on me to mitigate."

"To avoid constantly breaking things, I wrote a script that monitors file changes to production and commits any changes to a branch in the repository. I'll then merge their changes into the working mainline. It's usually a few JSP files with some text or a link updated, but recently, when I went to fetch the current status, I was greeted by this friendly result:


Flexible Spending

by in Error'd on

"I spotted this at the Airport of Valencia in Spain," wrote Peter P, "looks like they have quite weird temperatures there..."


SQL MUGging

by in CodeSOD on

"We're replacing an old PHP website," writes Roggo, "to examine the existing functionality and test the install, we were given access to the live site. Out of curiosity, I had a look at the code that we are soon to replace. The first file I opened was called mug_password_forgotten.php; I was greeted by line 8:"

$sql = "select muguser_id, muguser_directory " . 
       "from mugusers " . 
       "where muguser_active = 1 " . 
       " and muguser_email = '" . $_POST["email"] . "' ";

The 10 Key, Mr. Kashmere, and More Support Tales

by in Feature Articles on

Mr. Kashmere (from John A)
Mr. Kashmere is one of our middle school teachers. There had been a merger of two schools, and everything had changed: administration, policies, procedures... and technology. One of the new technologies they had picked up as a small school was Google Apps, including Gmail.

When I heard that Mr. Kashmere was having trouble getting new e-mail, I was curious, and figured I should go have a look at what the problem was.


Dirty Code

by in CodeSOD on

Ever since being hired, Adam had spent most of his time working on new projects.

He was aware that there was an "old system" running out there and would someday be shut down and his efforts were to help this come about, but he never had the opportunity to cross paths with it.  Based on what he had heard though, this was a very, very good thing.


amp, #039 and a0B30000004la04EAA&

by in Error'd on

"I saw this on my way home from work," Daniel Moore writes, "thank goodness CVS is doing something about Maryland's crippling shortage of whooping cough!"


The Percent Conversion

by in CodeSOD on

"Lucky me," writes Joe from the Submit-To-WTF Visual Studio Add-In, "I just inherited a home-grown system information application."

"Judging from the code the previous programmer wrote, this is sadly one of the better pieces."