The Daily WTF - RSS Feed

Curious Perversions in Information Technology

Latest articles

Error'd: Some Sunny Day

Greenville resident Terry K. discovers the weather is on the fritz today. "The chanceOfTemplateFailure seems high today," says he.   Renault driver Drew W. predicts "We have always been under a severe thunderstorm warning, and we always will be." Thursday again?   Fellow motorist Robert F. blows up: "I was searching for winter...

CodeSOD: Filter Your Kwargs

Mark's team needed someone to write a pretty straight-forward report for their Python application. It would take a set of keyword arguments, turn those into a filter, apply the filter, and get the results back. This was implemented in two methods. First: def set_filters_to_query(modelquery, kwargs2): filter_by = {} if 'source' in kwargs2...

CodeSOD: World Class Contracting

The time and effort needed to complete a project and the amount of time available rarely line up well. Wayne M's company found themselves in a position where what they needed to deliver and what they could deliver by the deadline simply didn't match up. The requirements were well specified, so they bundled up a bunch of requirements for search-related...

CodeSOD: A Date With Yourself

Once upon a time, someone wanted to add a banner to a web page. They also wanted the banner to only appear after a certain date. Jack stumbled across their implementation when trying to understand why the banner would vanish for two weeks at the start of every month. // get date var MyDate = new Date(); var MyDateString; MyDate.setDate(MyDate.getDate());...

CodeSOD: Experience is Integral

Behind every code WTF is a process WTF. For example, Charles W was recently tasked with updating some file-handling code to match changes in the underlying file-format it parses. This is the C code which parses an integer: if ((*p == '-' || ('0' <= *p && '9' >= *p)) && retCode == -256) { retCode = 0; p = _tcsrev(p);...

Error'd: Unspoken

It's been quite a few years since I was last in Silicon Valley. So it wouldn't surprise me at all if some enterprising restaurateur has unveiled a trendy pub and stolen all the humorous thunder from Sean's submission. I'll be more surprised if they haven't. Says Sean K. "I love trying new beers, but these varieties remind me too much of...

CodeSOD: Quite the Event

A few years back, Alvin was in college, and took his first formal summer job as a programmer. It was supposed to be just some HTML layout work, and the designer handed him a few sample pages. "Just do it like this." The "sample pages" were a mishmash of random indentation, huge swathes of commented out code, and all those other little traits of "someone's...

CodeSOD: Getting Overloaded With Details

Operator overloading is one of those "dangerous" features. Like multi-parent inheritance, it can potentially create some really expressive, easy to read code, or it can create a disaster of incomprehensible nonsense. In C++, many core classes use operator overloading, most notably the I/O classes, which reuse (or abuse) the bitshift operators into...

CodeSOD: Contractor Management System

Maximillion was hired to maintain a PHP CMS. His new employer, up to this point, had just been contracting out work, but as time went on, contracting rates got higher, the amount of time required to add basic features kept going up. It was time to go ta a full time employee. "The system's pretty simple," the hiring manager explained during the interview,...

CodeSOD: Are You Active Enough?

Cornelius was working with some code where the objects might be "active" or "inactive". His code needed to do something different, depending on whether the objects were "active" or not, but fortunately, there was a handy-dandy IsActive method. Weirdly, that method required a bool parameter, but also returned a bool. Since there wasn't any useful documentation,...

Discover, share and read the best on the web

Subscribe to RSS Feeds, Blogs, Podcasts, Twitter searches, Facebook pages, even Email Newsletters! Get unfiltered news feeds or filter them to your liking.

Get Inoreader
Inoreader - Subscribe to RSS Feeds, Blogs, Podcasts, Twitter searches, Facebook pages, even Email Newsletters!