Recent Articles

Jan 2017

freE-Commerce

by in Feature Articles on

Douglas had just joined a large eCommerce company that was constructing its own in-house PHP development team. It was a big step for them, as they only relied on cheap freelance c0derz to get things done before. Because of this, Douglas and his cohorts had to maintain a glut of legacy applications made by people who were long gone.

A vast majority of the horrid legacy apps were created by a man simply known as Shayne. The sight of his name in the code comments would send icy chills down Douglas' spine. Shayne was freelance down to the very definition of it. His signature philosophy to coding seemed to be "roll your own" and his framework weapon of choice was a version of CodeIgniter that was two years out of date at the time he utilized it. An open cardboard box on a wooden floor


Overloaded Loop

by in CodeSOD on

Brian found himself digging through some C++ code, trying to figure out a cross-thread synchronization bug. It had something to do with the NetLockWait function, based on his debugging, so he dug into the code.

bool CMyDatastore::NetLockWait(DWORD dwEvent, long nRecord, CMySignal& Signal, DWORD dwTieout)
{
    bool  retBool;
    long  value;
    DWORD reason;
    DWORD currentAttach;
    CTimerElapsed timeout;

    timeout.SetTime(dwTimeout);

    retBool = false;

    while (timeout)
    {
        if (::WaitForSingleObject(Signal.GetEvent(), timeout) != WAIT_OBJECT_0)
        {
            break;
        }

        ReserveSynch();
        Signal.Pop(reason, value);
        ReleaseSynch();

        if (reason == dwEvent && value == nRecord)
        {
            retBool = true;
            break;
        }
    }
    return (retBool);
}

Not so Smart on Sundays

by in Error'd on

"Every Sunday my 'smart' watch does this. Other days, it displays an abbreviation of the day," wrote Lawrence W.


Who Backs Up The Backup?

by in Feature Articles on

Call Before You Dig Sign

A lot of the things we do in IT aren't particularly important. If this or that company doesn't sell enough product and goes under, it sucks for the employees, but life goes on. Sometimes, however, we're faced with building systems that need to be truly resilient: aviation systems, for example, cannot go down for a reboot midflight. Government services also fall toward the "important" end of the scale. The local mayor's homepage might not be important, but services like Fire and Rescue or 911 are mission-critical.


Checked Numbers

by in CodeSOD on

Dealing with types in dynamically-typed languages is always a challenge. Given a variable, does it hold a string? A number? An object? Without inspecting it, you have no idea!

Thus, most of these languages have methods for inspecting variables, where you can ask questions like, “is this a number?” and then decide where to go from there. This can make validating your inputs a bit more difficult.


Predict Correct

by in Feature Articles on

Spell check

Steven was an engineer at a US-based company whose leadership had decided to take some dramatic cost-saving measures. A mandatory company meeting convened at 12:00PM, with nary a crumb of food in sight, to allow management to make their big announcement:


The Mailing List

by in Best of Email on

The Best of Email feature is not one that gets a lot of traffic these days, but this particular submission couldn’t fit anywhere else. It started when Justus got a ticket: “customer spam filters are blocking our emails”. How on earth was he going to fix customer spam filters? He almost replied as much to the ticket, when he noticed that the end user had helpfully attached a sample email.

This was the “to” line… and I present it here in its entirety, exactly as supplied by Justus. I apologize to mobile users in advance:


Nicht Gesprochen

by in Error'd on

"I can't read German, but that doesn't look like glowing praise," writes Bruno G.


Unstructured Data

by in Feature Articles on

Alex T had hit the ceiling with his current team, in terms of career advancement. He was ready to be promoted to a senior position, but there simply wasn’t room where he was- they were top-heavy as it was, and there were whispers among management of needing to make some cuts from that team. So Alex started looking for other openings.

There was another team at his company which had just lost all of its senior developers to other teams. Alex knew that was a bad sign, but in general, climbing the career ladder was a one-way street. Once he had a senior position, even if it was terrible, he could transfer to another team in a few months, keeping his senior title and salary.


Popping a Plister

by in CodeSOD on

We live in a brave new world. Microsoft, over the past few years has emphasized, more and more, a cross-platform, open-source approach. So, for example, if you were developing something in .NET today, it’s not unreasonable that you might want to parse a PList file- the OSX/NextStep/GNUStep configuration file format.

But let’s rewind, oh, say, five years. An Anonymous reader found a third-party library in their .NET application. It never passed through any review or acquisition process- it was simply dropped in by another developer. Despite being a .NET library, it uses PLists as its configuration format- despite .NET offering a perfectly good in-built format. Of course, this C# code isn’t what we’d call good code, and thus one is left with an impression that someone hastily ported an Objective-C library without really thinking about what they were doing.


Sponsor Announcement: Hired

by in Announcements on

There are certain tropes that show up in our articles, and judging from our comments section, our readers are well aware of them. For example, if a manager in a story says, “You’re going to love working with $X, they’re very smart,” it’s a pretty clear sign that the character in question is not very smart, and is almost certainly sure to be TRWTF in the story.

Part of this is narrative convenience- we try and keep our articles “coffee-break length”, and dropping a few obvious signals in there helps keep it concise. Most of it, however, really boils down to the fact that reality is full of certain patterns. The world is full of people who aren’t half as smart as they think they are. There are legions of PHBs ready to micromanage even if they haven’t a clue what they’re doing. And there are a lot of employers that can make a terrible job sound really great for the duration of the interview process.


The 3,000 Mile Commute

by in Feature Articles on
A true story, recounted from personal experience by our own Snoofle.

Many decades ago, DefCon Inc, a defense contractor working for the US military was attempting to get awarded a new contract to build some widget needed for combat. As part of their proposal, they wished to demonstrate that they had the available staff to dedicate to the project. Toward this end, they hired more than 1,000 assorted programmers, project leads, managers and so forth. The military folks that were evaluating the various proposals saw a slew of new employees that were completely unfamiliar with the relevant processes, procedures and requirements, and awarded the contract to another firm. In response, the contractor laid off all 1,000 folks.

A few months later, another such contract came up for grabs. Again, they hired 1,000 folks to show that they had the staff. A few months later, that contract was also awarded to another contractor, and again, all 1,000 folks were laid off.

A map showing the routes between Newark Airport and LAX

Eventful Timing

by in CodeSOD on

I once built a system with the job of tracking various laboratory instruments, and sending out notifications when they needed to be calibrated. The rules for when different instruments triggered notifications, and when notifications should be sent, and so on, were very complicated.

An Anonymous reader has a similar problem. They’re tracking “Events”- like seminars and conferences. These multi-day events often have an end date, but some of them are actually open ended events. They need to, given an event, be able to tell you how much it costs. And our Anonymous reader’s co-worker came up with this solution to that problem:


Banking on the Information Super Highway

by in Error'd on

"Good to see Santander finally embracing modern technology!" writes Sam B.


Extended Conditions

by in CodeSOD on

Every programming language embodies in it a philosophy about how problems should be solved. C reduces all problems to manipulations of memory addresses. Java turns every problem into a set of interacting objects. JavaScript summons Shub-Niggurath, the black goat of the woods with a thousand young, to eat the eyes of developers.

Just following the logic of a language can send you a long way to getting good results. Popular languages were designed by smart people, who work through many of the problems you might encounter when building a program with their tools. That doesn’t mean that you can’t take things a bit too far and misapply that philosophy, though.


A Case of Denial

by in Feature Articles on

RGB color wheel 72

On his first day at his new job, Sebastian wasn't particularly excited. He'd been around the block enough times to have grown a thick skin of indifference and pessimism. This job was destined to be like any other, full of annoying coworkers, poorly thought out requirements, legacy codebases full of spaghetti. But it paid well, and he was tired of his old group, weary in his soul of the same faces he'd grown accustomed to. So he prepared himself for a new flavor of the same office politics and menial tasks.


Mapping Every Possibility

by in CodeSOD on

Capture all

Today, Aaron L. shares the tale of an innocent little network mapping program that killed itself with its own thoroughness:


Healthcare Can Make You Sick

by in Feature Articles on

Every industry has information that needs to be moved back and forth between disparate systems. If you've lived a wholesome life, those systems are just different applications on the same platform. If you've strayed from the Holy Path, those systems are written using different languages on different platforms running different operating systems on different hardware with different endian-ness. Imagine some Java app on Safari under some version of Mac OS needing to talk to some version of .NET under some version of Windows needing to talk to some EBCIDIC-speaking version of COBOL running on some mainframe.

Long before anyone envisioned the above nightmare, we used to work with SGML, which devolved into XML, which was supposed to be a trivial tolerable way to define the format and fields contained in a document, with parsers on every platform, so that information could be exchanged without either end needing to know anything more than the DTD and/or schema for purposes of validation and parsing.


Errors for Everyone!

by in Error'd on

"All I wanted to do was to unsubscribe from Credit Sesame emails, but instead I got more than I bargained for," writes Shawn A.


A Font of Misery

by in Feature Articles on

After his chilling encounter in the company’s IT Cave, new hire George spent some time getting his development workstation set up. Sadly, his earlier hope that the PC in his office was a short-term placeholder until something better comes in was dashed to pieces. This PC was a small-form-factor budget system, relying on an old dual-core processor, 2 GB RAM, a 5400 RPM “green” disk drive, and integrated graphics with a single output port, to which was connected an aging 17" LCD monitor with a failing backlight.

A preview of a glitchy font


Sche-ma

by in CodeSOD on

In the early 2000s, it was a time of darkness, a world of fear, it was the age of XML. As someone who was just entering the industry at the time, you couldn’t type three lines of code without a PHB asking, “Have you considered using XML for this?” Since this was 2002, “this” was likely trying to find a way to emulate the marquee tag in JavaScript, the answer was usually, “No,” at which point you’d be reminded that we should be using XML for everything, so throw it out and start over in XML.

One of the key selling points of the grand power of XML was the idea of schemas. These magical little files allowed you to use XML to specify the structure of some other XML, and then validate various XML documents against that schema. Combined with the ability to use namespaces, this was truly the One Format to Rule Them All™.


The Helpful Manager

by in Feature Articles on

Computer-security-incident-initial-process.png

Git is a divisive piece of technology. There's a number of people who insist that it's the best of all possible version controls, often citing the fact that a complete repo copy is on everyone's computers in case of emergency. There are also a lot of horror stories of people screwing up commands and ending up neck-deep in tutorials, desperately trying to undo what they did. Recently, I was involved in a discussion about the merits of Mercurial. The usual git fans stopped by to ridicule the lack of history-rewriting in Mercurial, insisting that it's a necessary part of any version control. Which reminded me of this reader submission ...


Do You Think This is a Game?

by in CodeSOD on

We’ve passed Christmas and made our way through a Steam sale with our wallets mostly intact, and now most of us have a pile of games that we’ll probably never actually play.

Game programming is hard. Setting aside the “cultural” problems in the industry- endless crunches, compensation tied to review scores, conflicts between publishers and studios, and a veneer of glamour over unglamorous work- the actual work of developing a game is a hard job.