Alex Papadimoulis

Founder, The Daily WTF

Jul 2012

Denumerating the DayOfWeekEnum

by in CodeSOD on

"When I first found this custom 'enum'," writes Garrett Hopp," I had assumed that my predecessor had re-implemented the DayOfWeek Enumeration. I suppose that wouldn't be that big of a WTF as discovering the built-in DayOfWeek does involve using a search engine... which many developers seem to struggle with."

"But upon closer inspection, I realized it's a bit more than that, and is a really clever way to write (int) DateTime.Now.DayOfWeek. After all, that'd just be lazy."


Free TDWTF T-shirt Day!

by in Announcements on

Last September, our good friends and long-time sponsor New Relic helped us put on the infamous Free TDWTF Mug Day. The feedback from everyone was overwhelmingly positive: not only did they get to try out a pretty cool application performance monitoring service, but they got one of the coveted TDWTF mugs.

Well as you may have gathered from the title, we're at it again. After years of stalling, we’re finally putting out some new The Daily WTF T-shirts. And even better, you can get one of these limited-print T-shirts without even having to pull out your wallet.


Lucky Pointing

by in Representative Line on

"When I look at the way that my predecessor wrote his code," Benedikt B wrote, "I can't help but wonder if he understood pointers as well as Kramer understood write-offs."

"The fact that our C++-based application manages to not crash for nearly a whole day is nothing short of a miracle, especially since the only decision process behind whether to use &, *, ::, or –> seemed to be whichever compiles and recovers the cleanest after a try/catch failure.


Net -5

by in Error'd on

"I got this bill from Comcast," James Wilkinson wrote, "apparently it was due 5 days before it was generated."


Does Not Compute: Rodents, Dendro-computing, and More

by in Feature Articles on

I guess it's been quite a while since I did the last Does Not Compute, but here goes another round! Please do send in your own stories, and who knows, in a few years we may see another .

Rodents (from Milo)
A while ago I was working as IT support for several research stations. One day we got a strange call.


St. Louis Days of .NET 2012

by in Announcements on

Yes, I suppose The Real WTF™ is a conference named St. Louis Days of .NET, but like most curiosities there's a good reason. What used to be a single day (and an aptly named) event turned into three days of sessions, networking, and all sorts of other exciting things for  .NET developers. And it's at a casino, which means I'll be raking it in with my Perch Roulette Strategy, in addition to doing a talk or two.

Speaking of which, here's the talks I'll be giving…

Ugly Code: Beauty is in The Eye of the Beholder


Confessions: The Phone Number

by in Feature Articles on

"One morning," wrote Justin Reese, "my client reported that was a strange bug on a certain page in an app I built for them. Where the contact information for a series of offices was being displayed, all the information was correct except for one piece: the phone number. For multiple locations, the phone number displayed was the same: 214-748-3647."

"I ran a quick query against the database to make sure that the phone number records were indeed correct, and in fact they were. Many of the phone numbers were 214-numbers (being that we're in Dallas and all), but there were only a handful of expected duplicates. Not nearly as many as were being displayed. More peculiarly, on my local machine, the phone numbers were displaying just fine. I tried them out on the test site, only to find they were working there as well.


Dpogf sf odf !qAspo

by in Error'd on

"I spotted this at Heathrow Airport Terminal 4 just after the security check," wrote Ergin Salih. "One of the monitors is obviously trying to tell us something that nobody seems to be interested in, it just bounces around the screen."


The MySQL Wrapper Wrapper

by in CodeSOD on

Hey Pittsburgh Readers – I'll be in town this weekend, so who's up for grabbing a couple drinks tomorrow, Friday (July 13) Night at Market Square? Mark, Remy, and I will be there -- just drop me a line and we'll catch up. Oh, and I'll make sure to bring a TDWTF Mug for you if you’d like one (just let me know).


"A fairly ambitious project at work necessitated some extra, temporary help," wrote Richard, "and that meant it was time to bring on another contractor. After interviewing a number of different candidates, I found one that seemed to fit the bill. He had the necessary PHP skills, knowledge, and experience – and most importantly, he was will willing to work at the rate my company was willing to pay."


The Object Test, a New PI, and More SHEEIT

by in Coded Smorgasbord on

"I've been trying to fix up the last project a colleague completed before heading for greener pastures," wrote Philip Tyre. "After finding this comment, I'm beginning to have bad thoughts about what I may find lurking around..."

//  Apparently, in at least on situation, a Statically declared public
//  variable will hold its value across different browser instances making calls to the
//  same web page.
//  For now, reset these variables on Page_PreInit.

Sponsor Appreciation, Bad Magic Numbers, and More Error'd

by in Error'd on

TDWTF Sponsors

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!
ISVCon Logo   ISVCon - You know how to write software. Selling it is the challenge. That's where ISVCon comes in. Spend three days in Reno, Nevada between July 13-15 getting an intense education in sessions across two tracks on topics including mobile platforms, social network marketing, game development, and cloud computing. Register today!
JRebel Logo   JRebel is a JVM-plugin that makes it possible for Java developers to instantly see any code change made to an app without redeploying. JRebel lets you see code changes instantly, reloading classes and resources individually and updating one at a time instead of as a lump application redeploy. Download your FREE Trial Today!
Inedo   ProGet - a NuGet package repository that lets you host and manage your own personal or enterprise-wide NuGet feeds. It's a NuGet Server that's incredibly easy to set-up and install, plus it comes in a Free and Enterprise edition.

And now back to our regularly scheduled program...

 


Unconditionally Useless

by in CodeSOD on

"The code that I maintain was originally developed when OS/2 Warp was considered new," Danielle writes. "One of the biggest challenges I have is that the original coders are long gone, and the comments they left behind aren't exactly useful."

"They were firm believers in commenting not only the beginning of a conditional if-block, but also the end block. In theory, that can be helpful... but in practice, not so much."


For Whom the BEL Tolls

by in Feature Articles on

Photo Credit: dklimke @ flickr Although Martin had been a programmer at the company for several years, he was never was able to escape his second-rate status. And how could he? With two rockstar programmers at the helm, he was lucky that their brilliance didn't outshine him to a third- or even forth-rate status. Heck, he was just lucky to be in their presence.

The rockstars were known for a lot of things, and one of those things was always developing their own version of the wheel. Usually, with a rotary engine built inside. If a project called for a car, it was an okay fit. When it called for an airplane… well, they'd just build a carplane. A boat? Try a carboat. A beverage cooler? You don't even want to know.