Recent Articles

Apr 2013

Irregular Regular Expressions

by in Feature Articles on

Marcus A. worked for a man who believed that regular expressions were the be-all end-all and could be used to trivially solve every data problem that could possibly arise. Their code base was riddled with regular expression transformations that would reduce most developers to tears. This manager also believed that anything that could be explained could be implemented more cheaply offshore.

Their main application contained a raw text field that held comments by customers. Someone got the idea that these comments could be mined and used for business purposes. However, to do this in a free format text field, the non-standardized words and phrases used by humans would need to be cajoled into something that was more easily processed. To this end, Marcus was tasked with managing an outsourced effort to standardize this data. The input would be a Customer Data table with a comments column. The output would be the same column, but with abbreviations, acronyms, etc. converted to standardized text.


It's not the size that matters

by in Representative Line on

Arrays are one of the most basic data structures. They’re a primitive in nearly every language. In languages like C, they’re low level structures, which represent direct access to memory.

Wally’s co-worker, Brandon, wrote an array declaration:


Things Go Hilariously Wrong at Nuremberg

by in Error'd on

"The History Channel has a different interpretation of the events following the end of WWII than I was led to believe," writes Joe H.


Coin Toss of Doom

by in CodeSOD on

The ticket at the top of Brian's queue seemed strange, but not entirely unheard of. A user had entered in a bit of data in a text box on the company's flagship internal web app, clicked Submit and - boom - immediately redirected to a 404 error page. The next ticket was for the same app, same page, same text box and data, but, to make things interesting, the user reached instead a Java exception page.

The rest of the tickets landing rapid-fire into Brian's inbox were more of the same...and using the user's input, Brian could reproduce both results at will. So. Much. Fun.


Testing Patience

by in Feature Articles on

The process used to test new applications before delivering them to the user base at Eric's company had never been particularly formal. This is not to say that there was no process at all. Of course there was. After all, what kind of a company would develop software and then release it to the user base without running it through some testing. But 'rigorous testing' and 'robust validation' were not phrases used within his organization. Neither was 'successful rollout' or 'satisfied users', but that's a story for another day.

One reason for the lack of formality was that the company didn't feel that having dedicated testing resources delivered sufficient benefit for the cost. Shouldn't developers just write code that didn't have any bugs? Was that so hard?


The Apex of T-SQL

by in CodeSOD on

Thomas has some problems around the office. Specifically, the code he supports has all sorts of different ways to generate HTML. Rarely, it’s WebForms code living in as ASPX. Far more often, it’s hard-coded into the CodeBehind. Sometimes, it’s sitting in a resource file.

And then sometimes, it sits in a stored procedure like this:


The Six Million Dollar Patch

by in Feature Articles on

QA, UAT, and performance tests passed. John received authorization to promote his first major release to production. He checked in the code, and nothing exciting happened. No cake or streamers fell from the ceiling, but no errors or warnings bleated out at him. None. Given the complexity of the product, John’s success was the IT-world equivalent of winning both showcases on “The Price Is Right”.

John sent out emails to all the relevant stakeholders, and basked in the glow of a major project finally being done. The good feeling lasted for less than half an hour.


Got Any Spare Error'd Change?

by in Error'd on

"It seems Wolfram|Alpha thinks that $13.02 should be paid with three coins," wrote Christopher.


Do Not Remove Complete!

by in CodeSOD on

It wasn't easy for Ben to find a snippet from the monstrous codebase he maintains that fully demonstrates the Whiskey-Tango-Foxtrot rating it deserves. Sure, there were calls to the data layer from the UI, and, yeah, there was at least one method called DoSomething() that no one dared to modify. But those are all de rigueur at The Daily WTF. He needed something... more. Something worse. Something layered, like an onion, and twice as eye-watering.

He needed this:


The Scottish Breakfast

by in Feature Articles on

There were days when Robert felt like a British Monarch. He worked for a cryptographic hardware/software company based in England, and spent his time bouncing from client-site to client-site, all across Europe. One day, a Scottish customer named Willie called, panicked because his cryptography server had stopped working. “Achh, I’ve givin er all I can give! She willnut run any more!” Robert settled Willie down and asked the obligatory troubleshooting questions (Is it plugged in? Is it switched on? Was the crypto hardware unit connected properly? Has a giant sea monster eaten your server?) but to no avail.

Robert then broke the news to Willie: this required on-site service, and Robert wouldn’t be available until the following week. “I’m actually in France today, at another customer site.”
“That willn’t do, laddy! I need this workin before I go to the Aberdeen football match on Sunday!” Robert informed Willie what the charges would be for an emergency weekend visit and Willie agreed without hesitation.


Nine Ways to Tuesday

by in CodeSOD on

Devan L. was playing with his young daughter, when she asked him if he knew all of the days of the week. He replied: Sunday, Monday, Frogday, Flubberday, ...

She quickly admonished him for being silly. He told her that he was a very busy man and that there were too many days to remember. They laughed.


Manual Time Entry

by in Feature Articles on

Kolby had gotten a stellar reputation as a developer able to solve difficult problems. His newest client was an international food supplier. "We’re so glad you’re here," said Rita Manesh, the CEO. "The IFS Quality Control scheduler is too slow. It takes fifteen minutes to enter a single schedule. We hired five developers before you to make it faster, and they couldn’t do it."

"I’ll give it a shot," Kolby said. "Do you have the source code?"


My Computer is to the Limit

by in Error'd on

"I'm not sure what AVG does to get this sort of boot speed, but I want it for my new laptop," writes Allan.


Mini-GUID

by in Representative Line on

Let's say, hypothetically, that you need a bit of code to create a unique key in a database table that starts with an "N" and it MUST fit within the limits defined by a varchar(20) column.

You might think that transforming a database sequence ID might be a good way to go, but no, your project manager demands something more...robust. More unique. What to do? Well, Jay sent in the obvious answer: Use a GUID!


Code PaLOUsa & KCDC

by in Announcements on

It's an exciting couple weeks for us developers in the Midwest!

First up there's the Code PaLOUsa conference. It's April 25-27 in Louisville, Kentucky and features a great variety of talks, and most certainly a lot of bourbon


The Database Master

by in Feature Articles on

Maurice had always found it curious that his company didn't administer any tests to new hires. It seemed like a minimal amount of work to save the company time and money. The new "IT Systems Expert" that HR sent to his department did little in his first few weeks to dissuade Maurice from his opinion.

This particular expert, Ben, liked to toot his own horn. He would toot it at length, and to whomever was in the vicinity. He was tooting one of his favourite achievements at Maurice one day, a gripping story of triumph at a major telecom company, when the telephone rang: A branch office couldn't access the main application supported by Maurice and his team. He turned to Ben.


Switching It Up at the End of the World

by in CodeSOD on

Conditional operations are so common, languages have evolved an entire family of ways of expressing them. This lets the developer choose the best expression for their needs, whether it be a traditional if/then/else, a switch block, or a ternary operator.

Sometimes, developers don’t make the right choice. Sometimes they don’t make the right choice twice in the same statement. Sergej sends us this:


A Fat Pipe

by in Feature Articles on

The 1990’s: a simpler time, when our cell phones only made noise when we had an incoming call, and the most amusing thing a computer could do was render 3D pipes, or flying toasters. The CTO of Paul’s company, Mario, was easily amused.

Mario’s experience as a Microsoft Server administrator/evangelist led him to claim Microsoft’s offerings were far superior to any other server technology. Windows NT, he argued, was so easy to use that any idiot could set it up. This made Mario the prime candidate to configure their behemoth of a web server: dual 200MHz Pentium Pros, 512MB of RAM, fast SCSI disks, and Windows NT4.


Battle of the Stock Wizards

by in Error'd on

"Apparently Yahoo's ad chooser has decided that I'm VERY vulnerable to the opinions of mentally disturbed stock wizards. I wonder if they both picked the same stocks?" wrote Matt, "Anyway, it isn't that hard to make good predictions for 2012.


The Windows 7 Upgrade

by in Feature Articles on

The latest fad among free-wheeling startups may be BYOD, but government offices tend to be far more conservative. Government offices handling confidential data even more so. When Miguel started his contract with a state office, they issued him a laptop. For security reasons, he was forbidden from using any other machine, nor should anyone else use his. Also for security reasons, the laptop was not allowed to leave his desk. It was locked in place with a security chain too short to move the laptop more than a few inches.

The computer had a great deal of… character. It was so old that archaeologists kept stopping by, asking to place it in a museum. Over its lifetime, it had received a few upgrades. The HDD was 500GB, and its RAM was maxed out- at 2GB. This created special challenges for Miguel, since their software required VS2003, VS2005, VS2008 and VS2010, installed alongside their third-party SaaS reporting tools. The machine limped along on Windows XP.


Computers Need Weekends Too

by in CodeSOD on

We are all familiar with the cycle. We arrive at work on Monday ready to face the week in front of us. Over the course of the next five days the drudgery of the grind and the pettiness of the problems that attack us on all fronts wear us down until by Friday we can barely put one finger in front of the other. We celebrate our freedom on the weekend with all manner of revelry. Then, rejuvenated, we enter Monday with a spring in our step only to find ourselves beaten down again.

Yes, we all know and live this pattern. But we don’t expect our computers to emulate it.


A (Long Overdue) BuildMaster Introduction

by in Alex's Soapbox on

If you've been following The Daily WTF for the past couple years, you may have noticed an ad or two for Inedo or BuildMaster. But what you probably didn't know (at least, according to those I've met in person), is that Inedo is actually my company, and BuildMaster is the product I designed.

I've always been a bit hesitant to talk about these on The Daily WTF. It's not that I think you'd mind, but I've always felt that you come here to read about curious perversions in information technology, not about my professional attempts at improving software development. So thank you in advance for reading this – if you've been reading for some time, you know I don't make a habit of this.

Five Years in the Making


Technically Competent != Qualified

by in Feature Articles on

When I interview people, part of my observations include whether they can be understood, and whether they can understand me. After all, a huge part of working with someone, anyone, is communication; if you can't communicate with a person, you and that person are not going to be able to work effectively together.

We've all had to deal with programmers who came to our teams from foreign lands where languages other than our own are spoken. With some effort, one can learn to understand these folks, even through their sometimes heavy accents. However, it is required that they can understand and communicate in the language that we speak.


Tough to Separate

by in CodeSOD on

Reynard submitted the following through the Visual Studios plug-in. He writes that he was charged with making the Customer Values page go faster. Depending on the client, there could be hundreds or thousands of Values that can be attached to a user (Client). The user manages them through a standard checkbox-laden page.

He quickly came to learn that you'd only be able to pry CSV from the lead developer's cold, dead code.