Recent Articles

Aug 2011

The String Padding Trick

by in CodeSOD on

"Our system prints out its share of reports and thus has to deal with its share of string padding," writes Jon B.

"There are many, many ways to pad strings with spaces, but our developers has chosen to go use this 'trick' to do it. Here's one example, where a particular field needed to be padded to 30 characters... or perhaps 35"


Confessions: The Non-deleting Delete

by in Feature Articles on

It’s been a little while since I’ve published a confession like the rachetingDateObject and the Shopping Cart. Apparently, not many of you were willing to own up to your own curious previsions and submit them non-anonymously.

Fortunately, Matthew Schaad was not afraid to confess his WTFs and shared with us The Non-deleting Deleting.



The Rockstar's Guard

by in CodeSOD on

"Someone introduced me to The Daily WTF back when I was a freshman at university, and I've been reading it ever sense," writes Patrick, "I was convinced that most of the bad code was made up or exaggerated, and that I'd never have the horrifyingly irresistible compulsion pleasure of submitting bad code."

"However, now that I'm in the real world, and getting settled into my new job at certain, large financial services provider, I've started reviewing their codebase to get a feel for how they do things around here. Though the codebase was an uncommented beast conjured up through outsourcing to Kerbleckistan, none of it was quite WTF. At least, until I got to the code written by our in-house rockstar.


Remove Car Quickly

by in Error'd on

"At first, I thought it was a bit peculiar that I was expected to drive my car into the pump," writes Aaron, "and then I got concerned."


Double Line

by in Representative Line on

We've got two different representative lines from two entirely different systems.

The first is from Clay, who writes (via the Submit to WTF Visual Studio Add-in), "my coworker is a firm believer in highly-configurable systems and highly-descriptive property names. End result: a highly-obnoxious development pattern."


The Programmiss and Male Services

by in Tales from the Interview on

The Programmiss (from Willem B)
We were hiring and it was our lucky day: a female candidate had applied for the job! As a team of three male programmers who would likely get alarming results on the autism test, we knew that she would be a very welcome addition to our team.

Her name was Natalie and without even knowing what she looked like, we all had a crush on her. Over lunch, we nicknamed her the "programmiss" and convinced ourselves that she was a hot brunette who would write emoticon-commented code and lighten up the office with her charming aura and some fresh ideas.


God Date Mangling 101

by in CodeSOD on

Lori's coworker was a PHP God. His computer was named godbox, which matched his login name of god. A project that took other developers three month to finish, he was sure he could do in three weeks. On one such project, his code utilized all the power of CSS, JavaScript, PHP, and ImageMagic all to generate one graph, that's supposed to show the last 3 month of data.

In this project, each row in the table below represented a row of data per month.


UnAcceptability

by in Error'd on

"I came across this message while trying to change my company's address with Dunn & Bradstreet," Maq writes, "apparently, they found our legal status to be too, um, titillating, and therefore UnAcceptable."


Might as well JUMP

by in Feature Articles on

The life of a legal secretary is a real house of pain. Behind every successful law firm is a legion of secretaries and paralegals that make the entire practice work. When everything goes smoothly, they're practically invisible. When there's a loss of control, they take all the blame.

Tamy was used to it. Working with lawyers, day in and day out, had gotten her used to all sorts of unpleasant things. The lawyers, however, weren't the most unpleasant part of her day. It was a little program called JUMP.


The Alumni Variables

by in CodeSOD on

"Not too long ago," Aaron writes, "I applied for a Java developer position at a certain, prestigious university. Despite passing the technical assessment with flying colors, the department head rejected my application because, according to the recruiter, 'he really only hires alumni'. Eh, whatever."

"A few months later, the same recruiter called to see if I'd be interested in an interview. One thing led to another, and I ended up taking the job - apparently, the alumni Java developers they hired ended up making a bit of a mess of things. Upon my first look at the code, I saw a comment that said Create all the variables. What was beneath it was, in fact, all of the variables:"


Classic WTF: ITAPPMONROBOT

by in Feature Articles on

With my road trip to devLink this week, last week's recovery from con flu, and the previous week's GenCon... I'm a bit behind. But that's okay. ITAPPMONROBOT is one of my all-time favorites, and was originally published on December 18, 2007.


At the turn of the 21st century, Initrode Global's server infrastructure began showing cracks. Anyone that had been in the server room could immediately tell that its growth had been organic. Rackmounted servers sat next to recommissioned workstations, with cables barely secured by cable ties. Clearly there had been some effort to clean things up a bit, but whoever put forth that effort gave up halfway through.


Top-grade, SHA1 Encryption

by in CodeSOD on

Paul B always thought of himself as a moderately-paid consultant. With no real overhead, a policy against ties when meeting with prospective clients, and a general pickiness about the projects he'll take on, his rates tend to be pretty low. One company that looked right up his alley was a mid-sized manufacturing company that wanted a custom webshop. They went to the highly-paid consultants in town, but weren't too happy with the six-figure price tag. Paul's quote was in the five-figure range, which he felt was pretty moderate given that it was a several month project. Of course, the company wasn't too happy with his quote either, so they searched high and low for a three- or four-figure price. They eventually found one overseas.

Despite losing the bid, Paul never bothered unsubscribing from the company's mailing list - there was always something exciting about learning the latest in gimbal clamps and engine nozzle extensions. About a year and a half later, he received an exciting newsletter announcing that the webshop was finally live. Out of curiosity, he created an account to check things out. A few days later, he received an apology for lost orders - they didn't know who had ordered what, so they sent it to everyone who had signed up. And then came the "data breach" email — everyone's personal data (which, for Paul, was just his throw-away email) was now in the hands of some hackers. You get what you pay for never rang so true.


Sponsor Appreciation, A Web 0.1 Ad, and More

by in Feature Articles on

Our sponsors help pay the bills so please, try to check out what they do!

TDWTF Sponsors

Astah   Astah is a comprehensive modeling toolset that works with UML, ERD, DFD and mind mapping models within the same integrated platform. There's both a free trial and a free community edition available. They also put out a pretty unique guide called Zen and The Art of User Requirements that's worth a quick read.
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!
BuildMaster   Inedo - the makers of BuildMaster, a new and unique platform that applies the rigor of source control and the discipline of issue tracking to the rest of the application lifecycle. By integrating with numerous best-of-breed development tools, BuildMaster automates and faciliates everything from build management to workflow-driven approvals to database change scripts to production deployments.
SoftLayer   SoftLayer - serious hosting provider with datacenters in three cities (Dallas, Seattle, DC) that has plans designed to scale from a single, dedicated server to your own virtual data center (complete with racks and all)

And now, back to our regularly scheduled, slightly off-topic program.


The Phantom Duo's ChangeWord

by in CodeSOD on

"I spent almost a year of my life working with The Phantom Duo," writes David B via the Submit to TDWTF Extension, "while their tenure resulted in a lot of headaches, a few lost jobs, and a multi-million dollar explosion, there was one positive result: lots and lots of bad code."

"At least, that's a good thing for me, since I haven't worked with the code in years: it's like I have my own, personal The Daily WTF archive on a flash drive. This particular method seemed worth sharing - I even added a few comments to help understand it."


Bring Your Own Code Live at devLink 2011

by in Announcements on

I was a little distraught when I looked at my calendar today and realized that devLink – an awesome community conference in Chattanooga, TN – is next week. That meant that, once again, I was a little late in helping promote a great community conference. So late, in fact, that registration had been closed.

Fortunately, John Kellar (the main guy behind the devLink) re-opened registration just for The Daily WTF readers. I realize it's short notice, but you should really consider attending. There's a great speaker lineup, a bunch of sessions, two great events (Bring Your Own Code Live and a Baseball game), and a lot of fun to be had in Chattanooga!

Bring Your Own Code Live!


Supporting The Twenty Year Server Plan, The Ice Machine, and The Split Monitor

by in Feature Articles on

The Twenty Year Server Plan (from Christian Riesen)
One day, one of the customers we rarely hear from called with some computer troubles. They were a jeweler, one of those high-end ones where you call ahead for them to open the store to you whenever you feel like it, so I assumed they had top-notch equipped. But this was one of the many experiences that led me to adjust my views more to reality.

Their problem was a cinch: a dodgy network cable that was rolled over with a chair about a million times, and the shielding was actually touching the inner copper wires. As I was wrapping up and running some diagnostics, I noticed their server was being very slow.


The French Disconnection

by in CodeSOD on

"The application that I've been assigned to had a fairly common requirement", writes Shaun H. "It needed to be bilingual, supporting both French and English."

"I've worked on quite a few multilingual apps before, and have a lot of different patterns and anti-patterns, ranging from using a resource file for strings to copy/paste/translate. Now, I can add this Oracle-based function to the list."


Shocking Electric Rates

by in Error'd on

"The Chef's Choice soup on Friday seemed to be something to avoid," notes Fred M.


Classic WTF: Price In Nonsense

by in Feature Articles on

Price In Nonsense was originally posted on December 17th, 2007.


Some years ago, Pete, a clever coder, developed an application that tracked commissions for futures trading. Pete had long since left the company, his role now filled by Andy M.


Manually-propagating Worm

by in CodeSOD on

Ivan Montilla writes, "those of you who use Facebook have probably seen spam like Check who visited your profile and the like. It's almost always either a scam of some sort or a ruse to get you to download some malware."

"Recently, I came across a friend who had proudly become a fan of Check who visited your profile, 100% Working. And then another friend. And another. Wondering if it was a new type of mischievous worm, I disabled all scripting and viewed the profile. The first thing I noticed was that it prompted you to download a .vbscript file, which definitely wasn't a good sign. I opened it with Notepad to find this:"


Anarchy in the UK

by in Feature Articles on

"Scott, is your passport up to date? We've got a big contract in the UK that fits your skillset."

Scott worked for a US-based consulting firm. The company generally didn't do business outside of North America, but a satellite TV company wanted a WAP-based, data-driven application for their set-top boxes. They also had a check with a large number of zeros in it. Scott went to England.


An Enum or _2

by in CodeSOD on

"The company I recently started at creates products for military and law enforcement use," writes John, "naturally, fixing bugs is a high priority for us in the software department, despite the legacy code we have to work with."

"One day, when I was feeling especially masochistic, I thought I'd run our code through FxCop, a static analysis tool to see what came up. As I was scrolling through the infinity billion warnings, I noticed one about an enum I had never seen. So, I clicked on the warning to find this:"