Recent Articles

Oct 2015

Schrödinger's Tortoise (SVN)

by in Error'd on

"It's curious that SVN is simultaneously both clean and unclean until the computer is restarted," Hesham M. wrote.


Leading Development

by in CodeSOD on

H. J. works in a place where best practices are known, but bitterly opposed. You see, they have a lead developer who is more experienced than the rest, and it is his mission to show the others how things should best be done. Some of his finer resume-worthy accomplishments...

  • He removed salted hashes from the database and stores passwords in clear text
  • He swapped out the challenge-response mechanism and replaced it with sending clear text credentials in every request and reply
  • The data-access and object-persistence NHibernate layers were removed and raw db CRUD operations were exposed directly to the internet via these clear-text passwords
  • Set-operations (e.g.: delete-query) were replace with a select and then iteration over the resultant rows - each in its own session (race conditions, transactions: fuggedaboutem)
  • No keys or indices were used in db tables as NHibernate would handle it, even though many tables have more than a million rows
  • Mandatory helper classes log and swallow error and fatal exceptions, leaving them scrolling by on the lead dev's monitor, in case he has time to look at them (this way, the application keeps going and if anyone ever notices something didn't work correctly, they can go scrape the log files)
  • To simplify things, every class and interface had its own namespace and if possible, assembly
  • The build auto-increments the version number of all (changed) assemblies (e.g. just about every class) after each build and then commits it to SVN, pretty much guaranteeing merge issues
  • Created a utility to auto-insert "useful" comments for names of public classes, and name, type and parameters of public methods

This is one class, directly from version control, that deals with Visual Studio solutions and projects. SVN history says it has had precisely one change in it's nearly decade-long life: the addition of the auto-inserted comment:


Monitoring the Situation

by in Tales from the Interview on

Joe T recently decided it was time to go job hunting. This mostly meant deflecting emails from head-hunters, doing phone interviews with ignorant HR departments, and the occasional on-site interview with a possible employer. One of those on-site interviews brought him to an IT services company which handled a few large US government contracts.

004. Brasserie La Saint-Pierre à Saint-Pierre (Bas-Rhin)


The Hard Problem

by in CodeSOD on

I’ll warn you to start: this is a date handling CodeSOD, but that’s only a small part of the WTF. You see, there’s an old joke, “There are three hard problems in computer science: naming things and counting things.” This code has a hard time with the first:

       private string ReturnCurrentGMTTime()
        {
            string result = string.Empty;
            DateTime time = DateTime.Now;
            string fs = "yyyy-MM-dd'T'HH:mm:ss";
            result = time.ToString(fs);
            result += "+02:00";
            return result;
        }

Just Following Instructions

by in Feature Articles on

Cameron was a support rep for a Unix-based software package that had also been ported to Windows and Mac OS X. He supported every version, and quickly learned that not all ports were created equal.

Click Here. No, Here


Google's Time Travel Shenanigans

by in Error'd on

"10 minutes is pretty reasonable, but I don't think that I'm going to make my connection 2 minutes in the past," writes Rich H.


A Well Mapped Error

by in CodeSOD on

Marvin’s company had a problem. Their C++ application tended to throw out a lot of error codes. That was actually okay- that application had a lot of possible failure modes that it couldn’t do anything about other than cough up an error and quit.

The problem was that their customers weren’t particularly happy with messages like: Error: QB57, since it told them absolutely nothing. “RTFM” was not an acceptable response, so someone had to add some functionality to turn those cryptic error codes into meaningful messages.


Apache Chief

by in Feature Articles on
W.T.F. Community College hired a team of highly-recommended web design consultants to bring its website in to the 21st century. Paul was tasked with overseeing their work and supporting the new site upon go-live. After a couple months of grinding, they cranked out a beautiful new site that was accessible, navigable, and responsive. It also removed the old site's dependence on Flash, replacing it with a titanic mound of PHP and JavaScript that was run by Apache.

Paul and his team gave it a thorough beating in their test environment and everything seemed solid. They even gave a demo of it to the the head of W.T.F. Community College, President Skroob. He was able to easily find his way around, sign up, set his password to 1-2-3-4-5, and register for fake classes. It got the Prez's official salute of approval. The amazing new website was ready to be launched in time for the fall semester.

The first day of classes rolled around and suddenly everything didn't seem so rosy. President Skroob frantically burst in to the IT office shouting "The web site is down! The web site is down!" A quick check of the monitoring system didn't show anything wrong, and manual inspection didn't either. The server hosting the site was hardly breaking a sweat. No pressure on CPU, RAM, or I/O. Paul tried browsing to the site and the browser just hung. No errors, no nothing.


Sort, Then Add, Forever

by in CodeSOD on

Go-live day for the new CabinetWorld redesign was a tense, hurried affair. Developers streamed in at 5:00 AM, hoping to catch wind of early problems before most of the country awoke and started shopping. True to form, the overworked break-room coffee machine gave up the ghost at 5:10, but luckily, at 6:00 the boss brought in doughnuts, and by 6:30 a Starbucks run had been arranged. Everyone huddled in the war room, nervously watching the monitors as the number of concurrent visitors rose steadily. And then ...

1890s Burroughs adding machine


An Efficient Curmudgeon

by in Feature Articles on

One of the things a good developer should always strive for is efficiency. Slow code should be improved if possible. Complicated steps should be simplified or removed. Finding a poorly-implemented process which is costing company time and streamlining it is usually a good thing, and means more profits, which means larger paychecks and bonuses, and happy bosses. Right?

The ASS Automation System's corporate headquarters.
This is a real company, but not where our story comes from


For Quality Assurance Purposes

by in Error'd on

"I don't work for them, so when did it become my job to do their quality control?" writes T. K.


Validate My Feelings of Cleverness

by in CodeSOD on

It’s not uncommon to have a branch in your code along the lines of, if (debugMode) { doSomeLogTypeThingy(); }. Usually, we try and wrap that sort of stuff up and keep it far away from the actual business logic, and the result is a plethora of logging frameworks and diagnostic libraries.

They are, however, consistent about one thing: whether or not debugMode is enabled or not, the actual business logic should behave the same way. They’re designed and intended to be minimally disruptive.


Filing Data

by in Feature Articles on

Databases are wonderful things. They help you organize your data at multiple levels. Large logical units of data are stored in databases. Smaller logical divisions are stored in tables, and individual records are stored in rows. Once you have your data stored like that, you can access it in all sorts of wonderful ways.

Meertens6

Of course, there's more to it than that. Beneath the database is the file system. Beneath that, there are one or more drive arrays each with one or more disk drives, each with one or more platters. Read/Write heads move back and forth to access the data on those platters. All sorts of sophisticated mechanisms have been developed to minimize the dead time of having a head in the right place, but waiting for the platter to spin the data beneath it for retrieval.


A Type of Insanity

by in Coded Smorgasbord on

Types are fundamental to most programming languages. Even the loosest, duckiest type system is still a system of some kind. It’s impossible to be a programmer if you don’t at least have a vague understanding of what types are, what they mean, and how you use them.

Well, not impossible.

The Null Type


Run Crash Crash Run

by in Feature Articles on

As Max entered the room, he was instantly greeted by a scorching wave of heat.

BSoD in Windows 1.0


Installing Flash Player is Hard Work

by in Error'd on

"Installing Flash Player sure is hard work," Mike H. wrote, "good thing that Adobe suggested taking a bit of a break afterwards."


Sponsor Announcement: Scout

by in Announcements on

Our sponsorship program has been a great success, and we’ve got another great sponsor to help us keep this site running and bring you the horrors that your jaded eyes crave, along with special features like TDWTF Live and our recent BYOC contest about the Lucky Deuce. Our newest sponsor is Scout. They donate $10 to the Larimer County Humane Society every time somebody tries out Scout, and now they’re launching a new tool…



Not So Unique

by in CodeSOD on

When designing a database schema, it's often important to assign a unique identifier to each record. Such surrogate keys almost always make querying for data both simpler and faster, and the overhead of an additional column is usually a cost worth paying. As such, nearly all databases provide some means of generating such identifiers, either in form of sequential numbers, or more fancy UUID schemes.

Snowflake macro photography 1


Dual Helix

by in Feature Articles on

Bruce B., a recent high school graduate in need of a job, thought it was a good opportunity. A friend had set him up with a job at a one-man development shop. His new boss, Louis, would provide on-the-job training, and it paid well for an entry-level position.

Louis met Bruce at the former’s house and led him to a basement office. “Your friend told me a lot about you, Bruce,” Louis said. He had a smile like Jack Torrance from The Shining. “Is it true you can already program?”


The Most Pessimistic Search

by in CodeSOD on

Sometimes here at TDWTF, we get code snippets that are immediately obvious in their wrongness. But sometimes, the code only looks mildly inefficient, and it's up to the submitter to let us know how bad it actually is.

Common snail


Eins, Zwei, Zuffa!

by in Feature Articles on

Dave had been at Initech for a few years, and things were looking pretty good. Everyone was working towards a big project launch, and every team was on target, on schedule, and on budget. The management, however, was not confident, and decided to “increase quality”. Their solution was to bring in two experienced, highly-paid consultants from the land of engineering excellence: Germany.

A glass of beer


Adult Supervision Required

by in Error'd on

"I was found that my NAS was choking on small files," Lionel S. writes, "Now I know it was a marble all along."


A Handle on Events

by in CodeSOD on

As developers, we try to write software that will be helpful to our users. Sometimes, we'll do key-by-key examination of what they're typing to do auto-complete. Sometimes, we'll look at a type-field entry to display the relevant subset of subordinate fields to be entered. Sometimes, we'll even try to coalesce error messages so that the user gets one message with a list of mistakes as opposed to one message per mistake.