Recent Articles

Sep 2009

The Shenanigans Handler

by in CodeSOD on

"I'm a senior developer in a department developing, among other things, an Adobe Flex web GUI for the configuration of our products," writes Lucy. "Having worked on systems in the past which could require production fixes at 2:00 AM if something went wrong, I am a true believer in robust software (which allows you to sleep through the night). Fortunately, my current employment doesn't require that lovely on-call dedication, but it does leave me as the odd man out when trying to argue designing and implementing robust code versus time-to-ship with my team mates and manager."

Lucy continues, "I was recently addressing a reported bug when I discovered some code that finally made me realize why my methodology for robust error-handling was not important. One of my fellow developers had found a much quicker and easier method of error-handling: the shenanigans handler. What better way to describe this methodology than a quick code snippet."


Web 0.1 Forms

by in Feature Articles on

Ever since being introduced to Web 0.1 — also known as flyer-to-print-to-photo-to-print-to-scan-to-web design — I've come to realize that there's a whole parallel universe of web development out there. A bizarro world if you will, where HTML is used to display images of formatted text, CSS serves to define <B> as "font-style:italic", and aaaaaaaaaaaaaa is a linebreak. Of course, since most of these examples don't come from the professional world of web development, they only show up on The Daily WTF on days I feel like breaking the "professionals only" rule. Like today.

The first specimen from the bizarro web was discovered by Steve Green. On first glance, it appears to be a standard contact form. Upon closer inspection of how it is to be submitted, it's apparent that it is, in fact, a standard contact form... for the world of Web 0.1.


A First Date

by in CodeSOD on

"I don't consider myself to be a programmer," Michael H writes, "but I have written my share of Perl and PHP. It's not that I dislike coding, it's just that I've moved to the sys admin side of things, and it's probably better for everyone that my kind doesn't write code.

"However," Michael continues, "because our IT department is so small (just myself and a programmer), my job responsibilities do include fixing hyper-critical-emergency bugs should they arise when the programmer is unavaiable. The same holds true if hyper-critical-emergency server issues arise when I'm unavailable: the programmer will jump in and do what he can."


Manual str_replace()

by in Error'd on

Sergey Shelukhin discovered this new way to do str_replace().


The Designer's Cover Letter, Temporary Web Siter, and Scaring off Female Candidates

by in Tales from the Interview on

The Designer's Cover Letter (from Josh Perry)
One of the great things about the graphic design profession is that your first impression to employers — your résumé — is often your strongest. Unlike programmers, who generally have wait until the technical interview to show off their chops, designers get the chance to show off their background and skills in one little sheet of paper.

That said, we've posted a number of different graphic design positions over the years, and have been blown away by the response. Quite a few résumés have been on par with these ones. But there was one that stood out from the rest. It came via fax (which, wasn't even posted on the job description) and had the following cover letter.


CodeThatDocumentsItselfSoWellItDoesNotNeedComments

by in CodeSOD on

“When I first met the lead developer at my new job, we had a very long and very good conversation about code quality,” Ben Stilgar wrote. “He and I just seemed to click, especially when it came to self-documenting code: architecture should balance functionality and understandability, program flow should be optimized only after performance problem, and code should be clear and understandable, even if it takes longer to write.”

“You can imagine my excitement when it came time to opening The System, which was the lead developer’s masterpiece and culminated over a decade of design and development experience into a clean, almost-perfect application. You can also imagine my disappointment when I finally dived in and learned exactly what he meant by self-documenting code.”


The Picker Stampede

by in Feature Articles on

Craig Landrum grimaced, sucking air through his teeth, clenching his fists, and tightly shutting his eyes. It wasn’t so much the 300-pound robot that was stampeding full-speed towards him while rotating its menacing gripper arm, but more The Admiral, who was wide-eyed with fear and instinctually reaching for his sidearm. Cha-cha-cha-chunk. Craig peeked through his left eyelid to see that the robot had halted on its track, not less than two feet from them, and nearly tipped over before zipping away in the opposite direction. Needless to say, the demo didn’t go so well.

In spite of the seemingly hostile behavior, the robot that Craig was working with was not some sort of military killing machine on the verge of sentience. It was a Fichetrieve, an automated filing system manufactured by Lektriever that was designed to retrieve microfiche film from a room full of shelves and cabinets.


Loopy Validation

by in CodeSOD on

"I work for a company that takes over the development of certain parts of our partners' websites," Clark S writes. "Often, in the process of porting code, we'll come across some strange and archaic validation files, CSS hacks, and so on. I'm pretty used to seeing bad code (that's why they're paying us, after all), and I can't say I've found anything impressively bad. Don't get me wrong: it's bad... just not The Daily WTF bad."

"Of course, all that changed when I came across the code for a certain new partner. It really threw me for a loop (no pun intended) and taught me that, apparently, I've been using for-loops wrong all these years."


High Values of Zero

by in Error'd on

"This the statement I received with a check from a well-known e-tailer," John Sadowski wrote, "I believe high values of zero are involved but I'm not good at those complicated maths."


1285E8 & More Highly Specialized Support

by in Feature Articles on

1285E8 (from Kristoph Minchau)
I had a ticket come in from a Very Important User: a member of the Board of Directors. The problem was that he could no longer access the Citrix server. Looking at it, I determined that we simply needed to resynchronize his RSA security token.

After calling him up, I asked him to please tell me "what numbers are currently displayed on the front of the token?"


Kirkman's Ladies

by in Bring Your Own Code on

Well over 150 years ago, the Reverend Thomas Kirkman posed an interesting problem in The Ladies' and Gentlemen's Diary for 1850. The curiously-named publication was in fact a mathematical journal and, as such, Kirkman's problem was mathematical in nature.

Fifteen young ladies in a school walk out three abreast for seven days in succession: it is required to arrange them daily so that no two shall walk twice abreast.


Fan or Die!

by in Feature Articles on

So...much...fanning!!!Let's jump into the wayback machine, all the way to the summer of 1994. David G. was starting at his very first job out of school, developing some train control system software. Perhaps not thrilling work, but hey, it was a job.

"David, I'm so glad you were able to make your way here!" It was Tom, a thick, sweaty looking man in his 40s who gave a hearty, double-handed hand shake upon entering the door. "Us old timers have been hoping for some fresh experience to come to our department here!"


DELETE. No, INSERT! No, SELECT!

by in CodeSOD on

It seemed like a good idea at the time. Why hard code all those SQL statements when you can just soft code them in a configuration file? That way, the data model can be changed without the other layers needing to know about it. It's brilliant!

Although Jan Fabry wasn't around for the "let's put all our queries in a separate file" decision, he was around for support, which was long after all the decision-makers moved on to bigger and better things. "In practice," he wrote, "the idea didn't work so well. Especially when the name, the comment and the code seem to disagree about what to do.


Marketing Calculus

by in Error'd on

"I get the whole 'marketing math' thing," writes Darren Ferguson, "but I'm not sure how they arrived at this. Must be some type of marketing calculus?"


What's in a Name?

by in Feature Articles on

The year was 1993, and that meant one thing: Old Iron was finally ready for the scrap yard retirement after nearly fifteen years of faithful service to the university. Technically, the MVS-based mainframe had been well past its prime for quite a many years, but since it was used primarily as a data repository for research projects, no one seemed to mind. But what they would mind, however, was any sort of downtime in the transition to the new, UNIX -based research computer, so it was up to Todd M. Lewis to figure out how to ensure things went smoothly.

In order to give researches the opportunity to learn their way around Unix and adjust their processes for the new environment without disrupting ongoing work on Old Iron, Todd set up a migration process that would pull MVS data sets from the backup system (as not to interfere with “live” data sets users may be using) and copy them to an archive on the UNIX server. From there, users could check out copies from this archive and work with them under UNIX to hone their processes. If they screwed up the data, they could just check it out again from the archive.


The Ultimate State Selector

by in CodeSOD on

One of the fundamental axioms of software development — #9 on the list, actually — is that "there is always a better way." This holds that there is no such thing as Perfect Code, only Good Code which is appropriately correct, appropriately optimized, and appropriately documented for the situation at hand. On the other hand, a lesser-known axioms (#1873, for those keeping count) is that "there is always a worse way." No matter how bad a particular block of code may seem... someone, somewhere, somehow will develop something even worse.

Of course, this being The Daily WTF, I figured that we'd be above that latter axiom. With all of the bad code published here (don't forget: submit your own!), surely we've seen the worst possible way of doing something. The Absolute Zero of bad code, if you will. I mean, once you've seen one declare-a-boolean-variable-for-every-state-and-have-if-statements-determine-the-selected-state-and-print-it-out (like this), you've seen them all, right?


The Server Guys

by in Feature Articles on

Om nom nom nom nom nom nom nom nom nom nom nom nom nom nom nom nom nom nom nom. In my career as a developer, I've worked in a few organizations (and survived through my fair share of re-organizations) but the general pecking order stays the same with regards to IT. Developers work together and take direction from a Project Lead who is directed by a Team Lead, who answers to a Department Lead who in turn receives orders from a person at the Executive level. There's the same thing at Hobson's work, however, their org chart has a additional...twist.

You see, within its walls, there is a very special team that is above all others, and they are known as the Server Guys. Whatever they say goes, and nothing goes above what they say. They are the ones responsible for the maintenance and support of all of the company's servers, and they know what's best. Like the Men in Black, they are not only above the system, they are the system.


The Cookout

by in Souvenir Potpourri on

Ever since the first Free Sticker Week ended back in February '07, I've been sending out WTF Stickers 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: Meal Ready to Eat).


A little while back, I received one of the most awesome things one can receive via post: a steak dinner. However, in my write-up of the steak dinner I never mentioned how they tasted. Rick Hiester was curious about that, and decided to take action. "I've never had Omaha Steaks before, so in the interest of sending an 'ultra-awesome souvenir' and learning how they taste, here's a second round."


Classic WTF: The Cool Cam

by in Feature Articles on

I've been tied up on a "special project" these past couple of evenings, so I thought it'd be fun to share this great classic. And, of course, by "project", I mean Battlestar Galactica: The Complete Series and by "special" I mean "on Blu-ray." One of these days, I'll have to learn the discipline of Raymond Chen and have a few things queued up for urgent situations like these.

The Cool Cam was written by Jake Vinson and originally published on August 14th, 2007.



Sliding Around

by in Bring Your Own Code on

Andy Hertzfeld is a bona fide Software Wizard. I'm not kidding: it was his official job title, codified on his business card. And not just any old business card, but one from Apple Computer. You see, not only was Andy a key player on the Macintosh team, but he also had a knack for doing the impossible. One his feats was described in the September 1995 issue of Byte Magazine.

Besides everything else he did to help get the first Macintosh out the door, Andy Hertzfeld wrote all the first desk accessories. Most of these were written in assembly. However, to show that desk accessories could also be written in higher-level languages, Hertzfeld wrote a demonstration puzzle games desk accessory in Pascal. Like its plastic counterparts, users moved squares around until the numbers 1 to 9 were in order. As time began to get short, the decision was made that the puzzle, at 7KB [7KB = 7168 bytes], was too big (and too game-like) to ship with the first Macintosh. In a single weekend, Hertzfeld rewrote the program to take up only 800 bytes. The puzzle shipped with the Mac.

That's pretty impressive, especially considering that simply telling the story took a little under 800 bytes. Fortunately, Andy did have one thing going for him: sliding puzzles — especially of the 32 variety — are pretty simple. There are nine squares and eight pieces, and a piece can slide into the empty square.

1 2 3
4 5 6
7 8  

The Odd Job

by in Feature Articles on

Photo credit: ramseyarnaoot@flickr Their first correspondence was an unsolicited call from Vilhelm. "I'm calling because I hear you do web work." Gaye B. responded that yes, he did, and began collecting whatever scant details he could about the project, telling Vilhelm he'd need some time to prepare an estimate. Vilhelm casually mentioned "you know, your last name sounds familiar. You wouldn't happen to be the son of Bob and Alice, would you?" He was. "Oh, that's great! Our parents are friends, they met on vacation at the coast last year!"

Beautiful, Gaye thought, he's going to want the "friend discount."