Recent Articles

Jan 2012

Code PaLOUsa 2012

by in Announcements on

Last year's Code PaLOUsa (held in downtown Louisville) was a blast, and it was great to meet up with some of you guys who were able make it out. I'm definitely excited about Code PaLOUsa 2012; there's a lot of great speakers, and it's right in the heart of bourbon country.

My Talk — Ugly Code: Beauty is in The Eye of the Beholder

It's said that without evil there can be no good and that without darkness, there can be no light. Is the same true of ugly and beautiful code? Maybe... but that's certainly not a question I'll be answering in this talk. Instead, we'll talk about ugly code, where it comes from, how to avoid it, and how to rid your codebase of it. And of course, I'll share some of my favorite anti-examples from The Daily WTF.

The TDWTF Discount + Bonus!


Save the Project for Failure

by in Feature Articles on

If it takes two contract developers six months to drive a project to failure, then four developers should be able to fail in half the time! Josh assumed that was why he and Sam were carted out to the client site and tossed into the oubliette of the PowerPac project. They were armed with nothing but a rusty spoon and a requirements document so old it needed to be stored in an oxygen-free environment.

The original development pair was Sally "I can code but I'm more of a designer" Jorgensen (the CEO's daughter) and Billy "I taught myself HTML in a week and am now a programmer" Jorgensen (the CEO's brother). They ran the project exactly like you'd expect such a dynamic duo to run it- directly into the ground. By the time Josh and Sam joined, it was already well past deadline and over budget.


The .NET Whistleblower

by in CodeSOD on

Terry had spent the better part of the past decade digging through the trenches of QuidCorp's flagship application QuidFlow -- a program used to flowchart business processes. Though QuidFlow performed well and, overall, customers were happy with the product, whenever it came time to address a bug or investigate just how the filename validation worked; the source code was beginning to show its age.

Terry raised his concerns to management. Much to his surprise, management approved a plan to transition their C++ developers into the world of .NET through a little on-the-job experience.

Homemade with Love


19999 Below

by in Error'd on

"Mac OS X has an odd definition of gigabyte," writes Kevin Kelly.


Sketchy Skechers.com

by in Feature Articles on

Imagine yourself as an eager, young developer. After many long months of self-study, you’ve carefully honed your craft and have skillfully mastered virtually all development technologies from enterprisey to hipster. Your twelve-page résumé could land you a job anywhere, and as it would happen, the job you decided to take was at a highfalutin consultancy filled with like-minded developers who were almost as skilled as you.

You and you cohorts could build anything. Literally, anything: a software cure for cancer; a software cure engine that could dynamically load cure plug-ins at runtime to cure anything; or even a software engine factory that could dynamically create engines that could dynamically load plug-ins that could do anything.


The Storage Warehouse, The Most Ethical, and The Customizer

by in Tales from the Interview on

The Storage Warehouse (from Grig)
The first recession I remember was in the early 1990’s, and I remember it so well because I was looking for a job. The want ads listed an opening for a UNIX admin – something which was right up my alley – so I gave the company a ring.

“Ye-LLO!” was the greeting after a couple of rings. In the background, it sounded like John Philip Sousa March music was playing on a 1960s AM transistor radio.


Globally Coupled

by in CodeSOD on

"I work on a team maintaining a large and enterprisey PHP system," writes Amber, "and as such, my job mostly involves doing enhancements and fixing bugs."

"It sounds normal enough, if not for the fact that almost all variables are globals and each of them might or might not be initialized in the same way, or the same place, as seen in this screenshot."


Sponsor Appreciation, SQL Scourge, and More Error'd

by in Error'd 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 Cloud Instances 98% off - Design, deploy and manage your cloud instance on the public cloud for only $1 for your 1st month (normally $50/month!) Use your Cloud Instnace to test new code, experiment with new software or gain extra development time...it's your choice! Try it today with coupon code "CLOUD1".
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. Remember: performance is a must-have feature!
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.!
BuildMaster   Inedo - the makers of BuildMaster, the free, and easy-to-use, web-based deployment and release management tool. Going far beyond Continuous Integration, BuildMaster delivers a series of robust features unparalleled by other build-promote-deploy-distribute tools. Oh, did I mention it's free?
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 our regularly scheduled program...



Pluralized!

by in CodeSOD on

"When digging through some code that was on the refactor list, I came accross some validation logic that checks if the user selected enough options on the form," writes Chris Osgood, "if enough options weren't selected, you'd get an error message along that said something like 'at least 3 options are required'."

"It took a little bit of coding to get that validate message. The '3' was obviously dynamic, and if there was only one missing selection, then 'are' was replaced with 'is'. As for the word 'option'...it was is PLURALIZED!"


Support The Daily WTF in Supporting the Support SOPA Movement

by in Feature Articles on

It’s January 18, 2012 and, while most of the internet has decided to blackout their sites in opposition to the Stop Online Piracy Act (SOPA), we’re taking an opposite stance and are whiting-out The Daily WTF in support of SOPA supporters.

If there’s one thing that SOPA proponents like myself and SOPA opponents can agree on, it’s that PROTECT-IP and the Stop Online Piracy Act have little to do with protecting intellectual property and stopping online piracy.


Terrorists!

by in Feature Articles on

“She’s convinced that terrorists have compromised her computer,” Tom Davidson’s colleague – a front-line helpdesk technician – reported, “best I can tell, it’s some sort of virus problem, or something. It’s is a bit out of my league, but I’m hoping you can help.”

As a junior sysadmin for a mid-sized university, Tom found himself playing second-tier helpdesk support more often than not. He didn’t mind – it was certainly better than first-tier, after all – and he appreciated solving the unique problems that were escalated to him. The terrorist virus was definitely one such problem, and it was nothing he had heard of before.


Schizophrenic Haiku Comments and More

by in Coded Smorgasbord on

"I found a schizophrenic comment that either intentionally or unintentionally happens to be a haiku," wrote Ben Vanik, "svn blame says this single line is the work of 3 different people across 3 years of coding."

// should delete the temp files here, no cannot because, we havent read it in yet!

Classic WTF: Rutherford, Price, Atkinson, Strickland, and Associates Dentistry, Inc

by in Feature Articles on

I'm at CodeMash today (stop by the Inedo booth if you're there!), so I thought it'd be a great time for this classic. Rutherford, Price, Atkinson, Strickland, and Associates Dentistry, Inc was originally published on January 30th, 2008.


Dr. Rutherford July 19th, 2004 marked a new chapter in New Portlandopolis’s rich dentistry history. It was on that day that the bitter rivalry between Dr. Rutherford, DDS; Dr. Price, DMD, DDS; Dr. Atkinson, DMD; and Dr. Strickland, DDS/DDS-PhD, had finally come to an end. Though there’s much debate on what exactly started the feud, everyone knows what brought the dentists together: the nationwide “denta-corps” that can out-price, out-service, and out-anything their small, family dental practices.


The XML Escape

by in CodeSOD on

"One day, our logistics analysis vendor interface completely broke down," wrote Ben Davis, "that's a Bad ThingTM, as our primary focus is to provide logistical services to our clients."

"Fortunately, it didn't take too long to track the problem down. Our vendor was sending over unescaped ampersands in their XML API."


The Shredder

by in Feature Articles on

The company break room was, well, a company break room. Dull grey walls, acoustical tile dropped ceiling, burned coffee and a motivational poster featuring a sun setting over a beach. Leo sipped his coffee, pulled a face at the bitter taste, and muttered to Mike, "This sucks."

The Carribean island of Curaçao is known for sandy beaches, oil refining and open-air brothels. It's also notable for being a key junction where fiber lines from around the world branch off through the Americas. That last bit means that it's a popular location for running global datacenters. Leo's employer was a global business, and had not one, but two datacenters located on the island. The production datacenter handled millions of dollars of transactions every day. The backup datacenter didn't- in fact, it was being decomissioned, starting on this particular Monday.


Troubling Trouble Ticketing

by in CodeSOD on

"I'm not sure how he did it," writes Joey, "but one of my colleagues convinced management that we needed a trouble ticketing system. Since we had been using email and post-it notes for many years, it was a welcome addition to the team. Well, at least it would have been... had it not been a home-grown system written by Chad."

"The good news was that Chad had previous experience building such a system. The masterpiece of his previous job was a trouble ticketing system written entirely in VBScript that ran inside of Excel. After several attempts to make it work for us (it had a bad habit of only working on very specific versions of Excel) he decided to start clean using PHP and MySQL. A web-based system was a welcome alternative to a spreadsheet... at least, it would have been had Chad not recently learned about a 'new technology' called AJAX.


Calories Math, Exacting Password Requirements, and More

by in Error'd on

Cob spotted this in his local weekly flier.


Nondeterministic Months

by in CodeSOD on

"There's been a lot of talk that 2012 will exclude the month of December," writes Jon-Paul Murrow, "you know, end of world, Mayan calendar, Nostradamus, and all that. Even if this doesn't happen, there's no guarantee that future years will have twelve months."

"Fortunately, I found this snippet of JavaScript in our codebase at work that will find the number of months in any given year (that's right, any, year)."


Server Tent, Bridging The Gap, and More Server Set-ups

by in Feature Articles on

"I'm just a software guy, so I don't know much about wiring and whatnot," writes Chip, "but I'm pretty sure this isn't a good way to build out a server closet."


2012... Just Because

by in CodeSOD on

"Most people spend their New Year's Eve watching the ball drop and celebrating the New Year," writes Jason, "and actually, that's what I planned to do, too. Instead, I found myself debugging our licensing activation system." "Just as I was about to leave the office, I received a torrent of emails with the subject 'License Activation Failed'. One or two every now and then is expected, but dozens and dozens at four o'clock on New Year's Eve... not so good. It took me a moment to realize the significance of 4:00PM, but then it hit me: I'm on Pacific Time, which is UTC -8 hours.

"The error message that was filling up our logs was simply 'INVALID DATE' and for the life of me I couldn't figure out why. Our license code was a 32-bit number that represented the expiration date of the license and the features in the license. 7 of those bits represented the year since 2000, so obviously the date was fine up until 2127. After hours and hours of digging through PL/SQL, Java, JavaScript, Ruby, and some random shell scripts, I found the following.