Recent Articles

Oct 2010

Sponsor Appreciation, Open Source Child Care, and More

by in Feature Articles on

Please take a moment to check out the companies that sponsor Daily WTF.

TDWTF Sponsors

Microsoft Silverlight Firestarter   Microsoft Silverlight Firestarter - Light up your Silverlight skills with Scott Guthrie and the Silverlight product team in this one-day live-streamed and on-demand event on December 2, 2010 from 8:00 am to 5:00 PM Pacific. It's completely free, but seating is limited so make sure to register for in-person (Redmond) or online attendance!
BuildMaster   BuildMaster - an easy way to automate your build, deploy, and configuration process all the way through production. Basically, it's application lifecycle management the way it should be: platform neutral, process neutral, and tool neutral.
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)
Mindfusion   MindFusion - a great source for flow-charting and diagramming components for a variety of platforms including .NET, WPF, ActiveX and Swing
Peer 1   Peer 1 - provides award-winning Managed Hosting, Dedicated Hosting, Co-location, and Network services offered through 15 data center across North America. With over 10,000 businesses hosted on their legendary SuperNetwork™backbone, PEER 1 delivers one of the highest server performance and network outputs in the industry.

And now, back to our regularly scheduled program.


Submit WTF Code Directly From Your IDE

by in Announcements on

At the day job, I spend the majority of my time working on BuildMaster. While I certainly find it more exciting than the Big Boring Business App at Mega Financial Co, the structure is similar: there are a number of modules, different teams are responsible for different modules, and about the only change in scenery is working on a different module.

Though I wouldn’t call it boring, working on the same thing day-in and day-out can sometimes drag a bit. Even with an ample supply of Single Malt Scotch. Apparently, I wasn’t the only one feeling this, so we started a new company initiative: let developers work on projects that fall outside of their normal job description.


Double Spaced

by in CodeSOD on

If past CodeSOD articles are any indication, it would seem that "certain" developers have a very difficult time wrapping their minds around spaces and spacing.

How do you replace double spaces? What about triple spaces?? Or quadruple??? Clearly, these were questions asked by the coders of today's two specimens. And obviously, they found their answers.


Diseased

by in Feature Articles on

It wasn't Kyle's idea of a dream job, but when you have a PoliSci degree your options are either "unpaid slave labor in politics" or "parent's basement". So he leveraged the handful of CS classes he had taken as a backup, and managed to talk his way into a job. At the interview, he was shown some Java and VB code, which he was able to talk half-way intelligent about, and he discovered that he'd be working for Steve, his former Little League coach. A judicious application of communication skills and nepotism meant the interview ended with, "Can you start on Monday?"

When he arrived, he found a set of very large, very dusty binders sitting at his desk. A post-it informed him that these were some "training materials". Sharpied onto the front of the binders was a simple warning: MUMPS.


It's Not A Bug, It's Data Security

by in CodeSOD on

"I work for a nationwide retailer," Jody writes, "In one of the databases I work with frequently is a table called PRODUCTS which contains information about every item we sell, and on this table there's a trigger called PRODUCTS_TRIGGER which fires on every insert, update, or delete. One day while working on some unit tests I needed to insert a row into PRODUCTS, work with it, and then delete it when the test was complete, but the DELETE failed because of a problem in PRODUCTS_TRIGGER. When I looked at the code for this trigger I found the following sequence of comments:

    -- <name redacted>  mm/01/yyyy  This trigger was preventing deletes because
    --                              it's trying to insert NULL into the primary
    --                              key of the PRODUCTS_AUDIT table on DELETES.
    --                              Corrected problem by using :old.PRODUCT_ID
    --                              (which has a value) instead of :new.PRODUCT_ID
    --                              which is NULL when doing a DELETE.
    -- <name redacted>  mm/10/yyyy  <Name of VP in charge of security redacted>
    --                              insists this trigger be changed back to how it
    --                              was to "prevent a rogue process from deleting
    --                              products".

Bikeunsure

by in Error'd on

"While I appreciate Bikesure's pro-active communications," writes Oli Allen, "I really would have preferred some information about my insurance."


The Intern's Internet Disorder

by in CodeSOD on

It was the start of summer and Stephen was almost as excited about college junior Nathan's internship as Nathan was. Stephen’s company had a history of selecting new employees from their small group of fresh interns that started each summer and Nathan seemed like the right guy for the position.

To get his feet wet, Nathan would be first assigned to the SEO group where Stephen would be overseeing Nathan’s work. Though the SEO team was small when compared to the rest of the web development group, Nathan was in a position to make a big impact on driving traffic to the sites that Stephen’s company maintained and add a nice set of bulleted items to his resume or, if things worked out, a full time job after graduating from college.


Overloaded Help

by in CodeSOD on

"A certain coworker of mine is known for writing vast libraries of redundant Java code (example: makeStringArray(...)) in the hopes it will make everyone's lives easier," Jared writes. "That said, I wasn't at all surprised when I encountered this block of code."

"What's notable, however, is that when I first saw it, there were only 10 overloaded versions of setRecData(). I made the mistake of sarcastically asking him, 'but what if I have to set record data for twenty sets?' The next day, the improved version you see here was committed."


The Interesting Resume, The Insecure Resume, and More

by in Tales from the Interview on

The Interesting Résumé (from John)
Back in 2002, we needed an integration specialist for my team. This was after the dot-com bubble burst and previous ad placements online had resulted in getting flooded with résumés from desperate souls whose only qualifications for the job were that they could legally work in the US without Visa sponsorship.

This time, I placed a blind ad through our newspaper. The applicants would submit their résumés through the paper and therefore hopefully help us weed out some of the crazy, because taking the time to print and mail a résumé shows a tad more serious intent then just hitting "send" on email. I went down to the paper to pick up the first batch of submissions and was surprised at how many there were (50 or so). But there was one return address in the bunch that got my immediate and prompt attention.


Property Basics

by in CodeSOD on

Whenever a Code SOD featuring Visual Basic is published here, a flood of The Real WTF is VB comments ensues. As mindless and unoriginal of a comment as it is, there's a good reason for the sentiment: Visual Basic is designed for beginners, is often used by beginners, and beginners write an awful amount of awful code.

While it's easy to blame the language for bad code — *cough*PHP*cough*variableVariables*cough* — beginner-targeted languages can offer some benefits. Like, for example, the awesome fun and ease of using a single line of code like this: My.Computer.Audio.Play("cha-ching.wav")


Discovering New Math

by in Error'd on

"While checking my Discover Card balance, I was struck by the fact that I must have missed something in math class," writes Bill T, "either that, or this is an example of the hidden fees credit card companies are adding to accounts."


Push the Button

by in Feature Articles on

Much to his shame, Gary sends spam for a living. Not the spam that promises to enhance your sex organs, or let you view teenagers engaged in acts illegal in 43 states. He sends those newsletters and promotional notices that you delete unread on behalf of that company you bought something from once and have since forgotten about but can't be bothered to find the unsubscribe link at the bottom. So, not spam spam, but the content you couldn't care less about, nonetheless.

At one point, Gary was polishing up the data set underlying the company's largest campaign yet. Any campaign was complex, although this was an order of magnitude beyond that. Gary had to build an analytical model off of their address pool, isolating the target market segment, tacking on some demographic modifiers, and get that bundled up and handed off to their third-party bulk-emailing service. While he did that, swarms of graphic designers and copywriters actually built the promotional materials; they fought it out over the proper values for kerning in the banner and what color the footer should be. And again, all of that needed to be packaged up and handed off to the bulk-email service.


Cold Date Conversion

by in CodeSOD on

"Our customers were reporting a strange bug," Eric writes, "when they would select dates for events in December, they'd get the following message."

Conversion failed when converting datetime from character string 'De/09/2010'

Working Around, Over, and Through the Process

by in Feature Articles on

When Kevin landed a job at Townbank in the late 1980s, he came face-to-face with the same thing that thousands of newly minted developers had encountered before and since – there is more to being a corporate programmer than just writing code – there’s the process.

Second only, perhaps, to the strict rules commanded by the world’s religions, the process keeps the code consistent. Glory to the process – praised be the process - the process is good, the process should always be followed, and above all, the process is good for you!


The Why Timeout

by in CodeSOD on

Slade's colleague had a hard time grasping why. It wasn't that he was slow, more that he just didn't care enough to think things through. In some lines of work that’s not too bad, but in software development, it can lead to “interesting” results. Case in point: a timeout dialog.

The task was to detect whether someone forgot to log-out of the application and, if so, log them out of the system. This was an important feature, as the application was responsible for divvying up time-sensitive data analysis work. The first attempt was pretty straight forward:


Now with TDWTF Buttons!

by in Souvenir Potpourri on

Ever since the first Free Sticker Week ended back in February '07, I've been sending out WTF Stickers (and, now mini-buttons) to anyone that mailed me a SASE or a small souvenir. More recently, I've been sending out the coveted TDWTF Mugs for truly awesome souvenirs. Nothing specific; per the instructions page, "anything will do." Well, here goes anything, yet again! (previous: Salmiak Attack).


I've been reluctant to do another Souvenir Potpourri lately, especially after receiving those toxic goods last time. However, I have been slowly making my way through those Finnish treats, and have even gotten a few (now former) friends to try it. Of course, that wasn't good enough for you Finns; you just had to send more.


Security Frist!

by in Feature Articles on

Dean's company's codebase was a thicket of Amazonian Jungle- dense, tangled, and steamy. This was largely because there were no real standards for development. In an attempt to tame that wilderness, they organized a "governance committee" to be their machete. The committee established checkpoints for architecture reviews, design reviews, and code reviews. They maintained a list of standards, and told developers that new code should meet those standards.

After a few years in the company, Dean found himself on the committee. He looked forward to participating; even with the committee in place, there was a lot of bad code sneaking through that he ended up getting stuck maintaining. He was hoping for an opportunity to slap on a pith helmet and drive undiscovered species of bad code into extinction.


Documentation Done Right

by in Alex's Soapbox on

Of all people, I have a pretty high standard for doing things right. After all, I’m probably the last person who wants to be caught being The real WTF. This makes things tricky at the Day Job, <shameless_plug>where I work on BuildMaster, a pretty cool system that streamlines and automates the entire development, build, test, and deployment processes.</shameless_plug>, as I’ll often spend an exorbitant amount of time wondering about the best way to do something. Case in point: what’s the right way to do documentation?

Just to be clear, by “documentation”, I don’t mean manuals, user guides, feature matrices, and the like. Those are produced by technical writers, who seemingly enjoy living in the third circle of hell. What I mean is UML, Data-Flow, Flow Charts, Module Breakdowns, and all other works used internally by the development organization. And expanding on the question, which of these documents are we supposed to produce, and how much documentation is needed?

Documentation Done Enterprisey


Tweaking the Code

by in CodeSOD on

It wasn’t that Jim minded initiating interns into the world of web development, in fact, he viewed the challenge as a very satisfying experience. However, when the newest intern, Stefan, declared on his first day “I don’t want to be labeled as programmer for the rest of my life. Programming sounds too nerdy. I solve problems.” and that despite his ColdFusion experience, he had previously hosted raves and dance parties in his younger days (to further distance him from any chance of being considered a nerd). In short, Jim knew that he had a special case on his hands.

Rather than bruise Stefan’s apparently sensitive ego and give him an assignment that might involve invoicing or user security auditing, Jim handed Stefan a technical, yet practical, task - write a program to get the daily weather reports from a government website and store them locally so that users could see a cached copy rather than pulling it off the weather website each time.


Important Reservation

by in Error'd on

"I was without a pen and paper to write down this important information," Ryan O writes, "thankfully, my session wasn't interrupted."