Recent Articles

Dec 2014

Classic WTF - One Bad Ternary Operator Deserves Another

by in Representative Line on

Last day of 2014 means it's time to check out another year-end "Best Of WTF" article from earlier this year. Enjoy!


Personally, in all my years of application development, I have had zero use of ternary operators.


Classic WTF - Sweet Mysteries of Life

by in Coded Smorgasbord on

Check out a Classics republish of one of our most read articles from 2014. Enjoy!


When you read a lot of bad code, you start to get a sense of why the code exists. Often, it’s ignorance- of the language, of the functional requirements, of basic logic. Sometimes, it’s management interference, and the slavish adherence to policy over practicality. Other times, it’s just lazy or sloppy work.


Classic WTF - Line by Line

by in Feature Articles on

To close out the year, enjoy one of our popular articles from 2014. Happy holidays!


In the bowels of a business unit, a director got a great deal on a third party software package. He bought it, without talking to corporate IT, and then was upset when it couldn’t gracefully integrate with any of the corporate IT assets. Eager to throw good money after bad, the director hired his nephew’s consultancy to build an integration tool to make his new toy work.


The World's Worst Battery

by in Error'd on

"Maybe I need to order a generator with this one -- just in case I want to finish booting up the machine!" writes Matt R.


It's Christmas Day - Take a Break!

by in Announcements on

Seriously? Why are you reading this. Go do something with your family or your friends. There are more important things today than the internet.

Y Christmas Tree 2


Classic WTF - The Fizz Buzz from Outer Space

by in CodeSOD on

To close things out for 2014, we're re-running our most popular articles. Without further ado, enjoy one of our most popular; this one originally ran in September.


Matteo recently interviewed a candidate that was employed elsewhere as an “architect”. His responses to the standard soft-skills questions sounded a bit rehearsed, which made Matteo suspicious, so he started asking some more technical questions, like: “What’s the difference between an interface and an abstract class?”


Hashing the Ruby Way

by in CodeSOD on

Ruby praises itself as the language that “makes programmers happy”. It does its best to be expressive and encourage a declarative style of programming.

Oxygen480-actions-irc-close-channel


It's Raining on the Robot

by in Feature Articles on

It's Raining on the Robot

On the way to the data vault, Dave and his coworkers tried to list every rain-related song they knew. Here Comes The Rain Again was an easy one. Ryan, raised in the nineties, offered I'm Only Happy When It Rains. Justine tried to get out in front of the competition by rapid-firing November, Purple, and No. Thad, veteran of a hundred karaoke battles, offered Blame It On The Rain.

But none of them had heard It's Raining On The Robot before.


Metro Card Jackpot!!

by in Error'd on

"I really need to look into a cash-out option," writes Alvin.


A Perfect 10

by in CodeSOD on

two-hands-equals-10-fingersAndrew found this code on the product pages of a fairly popular automotive e-commerce website. It's called whenever an 'attribute' of a product (size, color, etc.) is selected or changed by the user.

The main focus of this code is to update a concatenation of the values of all currently selected attributes which are stored in a hidden form input field. Once it has done that, it hands off to another function to make an AJAX request with this concatenated value as a parameter.


Pass By NullPointer

by in Feature Articles on

Maxime was having difficulty viewing a website with the NoScript add-on installed to her web browser. It wasn't a huge surprise - some websites just don't work right with NoScript running, but it was a surprise when her browser displayed Java exceptions. Enabling JavaScript made the error page go away, but what? Lack of JavaScript causing Java exceptions!?

She viewed the page source and found that the server expects an "innerCHK" parameter, perhaps some kind of session or security token, to be passed in via URL query string. If it isn't provided, the server returns an error page displaying a java.lang.NullPointerException. Fortunately the front-end developers concocted this brillant snippet of JavaScript to resolve this issue:


JSON at Crystal Lake

by in CodeSOD on

Trevor found an unusual bug. Every customer had a GUID, but for some reason, their JSON API failed if there were ever more that 75 results.

He checked the web layer, only to find that it didn’t actually build the JSON- it just returned a string. The string itself came from their Oracle database. That’s where this procedure came from:


Woulda...Coulda...Shoulda

by in Feature Articles on

Have you ever done something that seemed like a good idea at the time? Then looked back upon it much later and had second and third thoughts about the wisdom of what you had done?

A long time ago, Jack worked for a company that had built a goods-declarations system for freight-forwarders so that they could get the blessing of the government to import/export their goods.


Good Help is Hard to Find

by in Error'd on

Daniel writes, "Looking for world class talent? Sorry...you won't be finding it here."


Polynomial Optimization

by in CodeSOD on

Marlschlag falsch&Schlingen

Rayer S’s co-worker exploded into his cube, beaming. “I’ve just optimized our processing loop. I’ve gone from O(n2) to O(n)!”


The Membrain

by in Feature Articles on

Michael was annoyed. Their in-house package manager- software that everyone needed to do their jobs- was complaining about a missing file that had just existed a second ago.

No big deal. First step: close the program, then re-open.

Cell membrane drawing-en

You Can't Fire Us Until We Quit

by in CodeSOD on

When one of Felix G’s newest design customers decided that they were officially unhappy with their current web-agency, another company's loss was his gain.

His first assignment was a simple one - remove the code that displayed the website’s creator credits (something like 'developed by xyz') from an external website.


Is Something Happening Right Now?

by in CodeSOD on

Most programmers are familiar with a notion of technical debt. Sometimes all it takes to make or break a project is a single bad decision, questionable design solution, or even a plain old bug that doesn't get fixed early on. The hacks and workarounds keep piling up, slowly turning the project into an unmaintainable mess.

In this regard, David was already off to a head start. He has recently been assigned to maintain a meeting tracking system with – to put it lightly - a bit of history. A year before, the marketing department of his company received the first version from a subcontractor and promptly implemented it – only to find out that the data gathered were a little off. According to the reports, every single meeting lasted exactly 24 hours – from midnight to midnight.


We're Not in Kansas Anymore

by in Error'd on

"After signing up to search for jobs at Comcast, I check out their locations map and wondered when Nebraska annexed Kansas," Herb wrote.


The Robot Guys

by in Feature Articles on

Business was booming during the formative years of SuperbServices, Inc. It was a blessing and a curse; like any startup, there was more work to do than people to do it. Telling the sales team to be less successful wasn’t an option, so the tech team had to adapt.

The CEO of SuperbServices tasked Roland with a major initiative that would save the company, or at least their sanity. “We need to automate all of this processing work, so we can focus on service delivery!”, the CEO said. “Our value proposition is our services, and everything else is busy work. We need to automate that, and that’s where you come in. I need you to engage the Robot Guys to work on automating everything: operations approvals, purchasing, money transfers, client emails, everything!”


Nasal String Length

by in Representative Line on

Dariusz isn’t sure what this line of code was meant to do. At his best guess, it was supposed to find an improperly terminated C string and add a null terminator character after it:

buf[strlen(buf)] = '\0';

Will Managers Never Learn?

by in CodeSOD on

Arty works on a team maintaining a legacy application that can best be described as a birds nest of code. It is a massive collection of global variables and a few tens of thousands of routines that would independently modify the data. Decapsulation was the overriding design pattern of choice. Of course, changing the value of some variable invariably has all sorts of unpredictable side affects. Naturally, this lead management to be fearful of making any changes, no matter how urgent, for fear of what would inevitably happen.

Fortunately, management recognized the need to replace it. The directive was given. A new application would be built. The replacement would be designed in such a way as to keep data and the routines that needed to access it somehow tied together. The state of a variable would only be changed as an end-result of some business action.


The Amazon River

by in Tales from the Interview on

Growth is challenging for any company, and the smaller a team is the more carefully they have to vet candidates to ensure a good fit. Carlos understood this, but had never seen it practiced as extensively as when he applied for a systems management position at Initech. The scrutiny applied to their candidates suggested a company obsessed with finding the perfect fit, and Carlos couldn't imagine the quality of the incredible team they must have already. Between the recruitment agency and Initech itself, he'd had three interviews and completed four online tests, including every developer's favorite: a personality quiz. Shaking hands with Carlos after the most recent interview, Initech's senior developer and his would-be boss promised he'd get a call that day or the next with the company's decision. Days went by before his phone rang, Initech's chipper HR person on the line.

"Hi Carlos! I was hoping you had a few minutes to answer a few questions."