The Daily WTF - RSS Feed

Curious Perversions in Information Technology

Latest articles

Error'd: You Spin Me Right Round

Audiophile Gear H. enthused "Love me some Bob Dylan. But it looks like I'll need to save up to complete my collection."   An anonymous Jira user reported "I'm glad to see that despite having a repository of any size, let alone 2GB, that it's still not in read-only mode.~" It's funny, I would expect an empty repository to be write-only....

CodeSOD: Constantly Finding Magic

We constantly see developers finding… creative solutions to the requirement that they avoid magic numbers in their code. Refactoring to define a constant is just too hard, apparently. Today, Maklemore sends us a short snippet that neatly solves the problem of magic numbers by making sure the number isn't a number, at least to start: if (eventToValidate.Location.StartMilePoint.HasValue...

CodeSOD: The DOM Checker

Dave does a little work on a website when the core developers are in over their heads on maintenance. Which is a thing that happens a lot. Let's see if we can get a sense of why, starting with this little method here: function check(cssclass, csschange) { if($(cssclass).length) { console.log(cssclass + " does exist "); csschange(); }...

CodeSOD: How To Ruin a Long Weekend

GRH inherited an application written by someone who is no longer employed with the company, as part of a project managed by someone who is no longer at the company, requested by an executive who is also no longer at the company. There are no documented requirements, very few tests, and a lot of "don't touch this, it works". Well, it worked until it...

CodeSOD: Height of the Accordion

In the bad old days of web development, you had to deal with the fact that there weren't really any standards, and you had to customize your code for different browsers. The "right" way was to sniff for which features were available, but the most commonly used way was to check the user-agent string and guess based on the browser name. Because of this,...

Error'd: Or Else

This week I read an article which asserted that the AI singularity is still several years away. Maybe they should wait until then before they start threatening us? The first of the last of the humans, Greg took the time to wonder about the meaning of this warning. Or is it a threat? "One of our in-house web applications implements an automatic...

CodeSOD: Literal Type Checking

Validating your inputs is important, even when the sender is an API- in the land of JSON-based data exchange, we can't guarantee which keys exist without checking. Philipp's team uses the "Runtypes" library to solve this problem. It lets them write code like this: r.Array(r.Record({ id: r.Number, name: r.String })).check(inputData) This verifies...

CodeSOD: Magic Math

LK was browsing a local job site for a new position. The site was flaky, which lead LK to look into the code, and it looks like if anything, this job site should be hiring a new web developer. function startSWBanner() { browserType = "new"; timenow = new Date(); secs = timenow.getTime () / 1000; modnum = 2 * 10; range = secs...

CodeSOD: Multiline Properties

If you want to configure a Java application, the standard way to do it is to use the Java Properties class. This class wraps around a simple, text-based file format (or an XML file, if you're into that) that allows you to store key/value pairs. It helpfully inherits from the HashMap class, letting you interact with those key/value pairs using a well...

CodeSOD: The 13 Month Bughunt

Code reviews are an important part of development processes, but sometimes, some developers manage to sneak around the process. That was the case with Orien's team, where most of the team were constantly checking in with each other, doing peer reviews, and trying to collaborate on a rather gigantic Perl codebase. One team member, on the other hand…...

Discover, share and read the best on the web

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

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