Gör spel!
by in Feature Articles on 2004-06-30Christer Kolterjahn sends in this little anecdote:
In the mid eighties, I once was
Christer Kolterjahn sends in this little anecdote:
In the mid eighties, I once was
Today's WTF reminds me of this one song (Let X=X) by Laurie Anderson. It's from reader Colin who mentions his coworker uses this continues to use this technique in hundreds of different methods ...
[EDIT: Used to link to an external article. Moved article inside post instead]
I didn't get any complaints about last week's long article posting, so today I bring you another longer story, by none other than Mohammamd Abdulfatah:
We were outside the main gate, waiting for security to come down and escort us to the deepest sanctums of the complex. We had been waiting for nearly two hours. At last, two guards came for us, their pace a slouch more than a march.
We waited for an elevator that never came, then we climbed down the stairs to the computers’ layer. A few minutes later, we were standing in front of a huge steel gate. One of the guards slid a magnetized card through a slot, an LCD screen above it flickered in excitement. The gate yawned, as if in agitation, opening its mighty jaws.
I don’t post on weekends for two main reasons. First, who actually reads blogs on the weekends? I thought that’s what work was for. Second, it seems that visiting TheDailyWTF.com from my home connection is like visiting it from a 1200 baud connection. Interestingly enough, TheDailyWTF.com is hosted at my house, and I’m probably physically 25 feet away from it right now. But today, I think I’ll brave the 30+ second page load time (seriously) and share with you this ASP VBScript include file from Michal Chaniewski:
This fragment of code logs request information with some details into DB. It looks like it was obfuscated with some tool, but wasn't. It is in fact this particular programmer’s style. This is just a little fragment of an e-commerce application using about 40 tables with cryptic table and field names, no stored procedures, at least 17 basic include files used on every page, all weighing about 50, 000 lines of code interpreted per request.
Thirty Days Hath September,
April, June, and November.
All the rest have thirty-one,
... yadda yadda something about February
I don't know about you, but that grade school rhyme helps me remember which months have how many days. On the occasion that I don't remember that, I'll consult my wall or desk calendar. If those are not within reach, I'll open Outlook or double click on the time in the system tray to get a calendar. But for some, such as Dewayne Christensen's colleague, a poem, paper calendar, or virtual control simply wont do. They'll find the last day of a known month programmatically, such as in this case of determining the lastDay of December ...
I'll admit it. When I first came across regular expressions, they seemed a bit intimidating. But, after spending about three or four minutes reading about them I felt a lot more comfortable. Apparently, Scott Elkin's colleague didn't feel like investing those three or four minutes learning regular expressions. Or looping through the individual characters on the string. Well ... at least this way it's all on one line.
[EDIT: There used to be an external link to an article. I moved the entire text to the post instead.]
Today we're going to try something new. I've receieved a few great submissions that are just too difficult to sum up in a few paragraphs. Natrually, they're more “What-The-F” than “Funny-Haha”, but I still found them an entertaining, worth-while read. So without any futher ado, Scott C. Reynolds wrote up an entertaining story about a frusterating relationship he experienced with a vendor ...
Summary
I came into a company dealing with a pretty infuriating software vendor, but since there was no development in-house before I was hired, we are now married to this vendor (for now). The following is a tale (one of many) of the Vendor from Hell. Our software vendor tried to ream us on the price of a printer integration, either out of greed or stupidity (though we suspect the latter given their track record) and now ends up eating crow and getting nothing. But the 3 month journey to the happy ending was like 90 Daily WTFs all in a row.
Story
We purchased a fairly expensive set of printers (like, $26K each) that are specialized to printing on small, close to 1"x1"x1/8", plastic cassettes which are used to hold bio-specimens in wax. We needed the printer installed at the lab and needed the lab techs to be able to print to this printer for the cassettes. There are 6 "magazines" for different colored cassettes, so like, say, breast tissue goes in pink cassettes, colon tissue in brown (gross but true..) and so on. Really, let's just think about them as "trays" rather than magazines.
So 3 months after the printers were shipped to the vendor, they say "Listen, it's going to cost you about 25k to have this done". We laugh our asses off. After talking to the president of the company, we find out that they haven't even researched this, they were just throwing a number out there. We say "well, you might be closer to getting this money if you were talking about 5-8k." They tell us how hard it's going to be, how they can't even find any documentation for the printer, and so on.
Yesterday we learned how truly unnecessary JOINs are in SQL statements. Now witness for yourself how Daniel Jin's coworker doesn't even need to use a WHERE clause ...
Gmail invite recipient Ravind Budhiraja sends in this snippet of code from his programmer colleague who apparently doesn't not believe in using an INNER JOIN:
I don't know how it happened. I don't know who took that first step. But someone did. Someone went and used Hungarian Notation to names columns in databases. And then a bunch of people followed. Now I won't go into how completely ridiculous I think Hungarian Notation is. I'll spare you an eventual admittance that it useful in some instances (when used properly). In fact, I won't even bring up my belief that those who abuse Hungarian notation (i.e. 95% of the people who use it) should forfeit their keyboards, apologize to their employer, and try a new profession (but not Civil Engineering).
No, none of that. Instead, I'll share with you this email from Tim Heuer, recipient of GMail Invite 2 of 6:
Even at The Daily WTF, it's important to have a break from the technical stuff. So today we have a snapshot from Steve Dunn, who captured this interesting scene outside of a cinema in Essex, UK. In case it's hard to tell, the yellow object is a trashcan about six to seven feet from the curb, made completely inaccessible by high hedges. It looks like some of the programmers featured on this site have started designing public amenities.
... at least, that's what I'd imagine the programmer behind this snippet of code (sent in by now-GMailer Jose Torres) would say if you recommended using a FOR LOOP:
Reader Richard Shew sends in this short but sweet Tech Support story:
As programmers, I think we all have our own unique way of doing things. I prefer having spaces between assignemnts (e.g. “dooDah = 28” instead of “dooDah=28”). I like having a variable declaration and initialization on the same line. I like indentation. And to be honest, I really am not a big fan of the whole curly brace semi-colon thing. So immagine my delight when Barry Etter showed me what a C contractor did to all the code he was assigned to:
Yesterday, Larry Osterman had to go and take the fun out of yesterday's WTF. So Larry (and everyone else) I hereby issue a challenge for you to justify the actions of Programmer X, as described by reader Jake:
I'll be the first one to admit that I'm relatively new to programming. "I'm relatively new to programming." There. So far be it from me to criticize what could well be a masterfully architected piece of software, so I won't color this. I'll just present the facts and let you, the reader, decide if a programmer at my company is stupid.
Some programmers feel that the code they produce is as much artwork as it is function. I guess I can agree with that, especially after viewing Anges Martin's The City at my local art museum, which reminds us that anything can be art. And with art comes creativity. So I'll bet that's what the author of this piece of code (sent in by Simon) was going for:
I didn't have any non-support-related or non-code-snippet submissions, and I'm trying to shoot for a bit of variety here :-). So, here's a WTF from yours truly.
For the past year or so, I've been working with a client to develop some rather complex web-based software to allow dieticians and their patients to manage a special diet that is supposed to help people with severe allergies. To populate our database, we copied the USDA's Nutrient Database, which has over 6,000 records, and had the client categorize and delete entries that she didn't want in the system. Interestingly enough, some of the "foods" in the 2,200 remaining records were Beaver, Horse, Opossum, and of course, my absolute favorite:
For those not aquianted with NIH, it stands for Not Invented Here and refers to the tendancy of programmers to avoid using third party tools because, after all, it's something that they could write themselves. I'd bet that it's something that we're all guilty of doing at least once or twice. But I can honestly say that I have never developed my own version of a built-in function, unlike the author of this VB6 function sent in by Eric:
I've been programming for quite a long time - since I was about twelve or so. Of course no one in there right mind would hire a seventeen year-old programmer (even one with five years experience), so I got a job as a PC support technician. And like many other technician-wanna-be-developers, I absolutely hated it. But in retrospect, I did get some pretty fun stories out of it. Although none as entertaining as this one, from Brent Railey's Technician Support days:
We sold a computer to an elderly lady who took it home. We had tested it, and it worked great at the store. But, when she got it home, she could not get it to turn on. I work on the phone with her for an hour.
I've had the pleasure of working with a developer who strongly believes that all classes external to your assembly (even core framework classes) should be wrapped in an internal class. The idea goes something like this. If your external class ever changes and the author decides to make it not backwards compatable ... and the new version of the class is actually required, you only have to change your wrapper class once instead of having to do a global search and replace.
Fair Enough. Reader Vijay's colleague employs this concept full throttle:
Yesterday, we learned that there is an entire Hall of Shame dedicated to bad UIs. But, I must say, I didn't see anything in there that would last half a round with The FileMatrix. I am still completely mystified by that UI ... and I haven't even braved installation (unlike Roy O)!
Anyways, moving on, Darren Sargent sent along this conversation he had with his coworker, a fellow “Senior Windows Developer” about unregistering a COM DLL:
No, not the the uburbulous deprodication errebelously conceived by "The Architect". I'm talking about the other matrix - The FileMatrix. Agent "G. Nickerson" was kind enough to send in a link to this UI where "simplicity" and "ease of use" seem to have gone the way of the telegraph. Take a gander for yourself:
Hope y'all enjoyed the long weekend. Althouh the preceding posts have been code snippets, I figure it's time for some variety. Be cool like Jason A. Mauss (who sent in the following), and send in your WTF-moments, from ridiculous boss-emails to mind-boggling code snippets.
Here’s a summary of an e-mail/WebEx/Phone exchange I had with a “sys admin” from a company we had sold our software to and we were trying to help them troubleshoot some problems they were having. Seriously, he was one of their sys admins. I’ll refer to him as “SysAdmin”. All names provided here are fictional to help keep the person and company that hired this guy anonymous. Before you read this dialogue– open up Task Manager if you’re running Windows…and sort the columns by highest CPU first…it will help add to your reading experience – and no, there aren’t typos in what their sys admin says – he just speaks very poor English.