Remy Porter

Computers were a mistake, which is why I'm trying to shoot them into space. Editor-in-Chief for TDWTF.

Nov 2012

LOGON.EXE

by in Feature Articles on

Companies beyond a certain size all follow the same basic pattern. Where possible, everything gets centralized in the global office- email, web servers, Active Directory, etc. They dictate policy and then leave it to the extremeties to solve their own problems within the corporate boundaries. Al worked at a factory, supporting their production management and chemicals management software- things that couldn’t be centralized.

Each day, when Al logged in, his computer greeted him with the standard warning message. “This computer is private property, and its use is subject to our IT policies (123.6, 216.2, and 551.A), and if you’re caught using it for porn or pirated software we will fire you so fast the unemployment line will be blueshifted.” Each time, he ignored it and clicked “OK”.


IInceptionFactory

by in CodeSOD on

The Factory pattern is an excellent way to solve a variety of programming problems using an object-oriented language. It’s a simple pattern, but for some developers, not quite simple enough. Den found this interface :


            

Code Comedians

by in Coded Smorgasbord on

When it comes to bad code, everybody thinks they’re a comedian. Heck, look at us! Stupid programmer jokes are a game everyone can play, though, so let’s enjoy an evening at the Improv with some code comedians.

Brian sends us this enum, which I’m sure was very funny back in 2007.


PHPTXTDB

by in Feature Articles on

College radio stations are small, but highly technical organizations. The era of the scruffy stoner spinning disks and mumbling into a microphone have been replaced by software systems that manage the station’s programming around the clock, and play recorded segments of scruffy stoners mumbling into microphones.

Kyle was the “tech-guy” at one station. Like any other small organization, the job involved doing anything from desktop support to server administration and some basic programming on the side. To keep the station’s website up to date, Kyle’s predecessor, Chad, had built a home-grown CMS-like system. Everything done by the station ended up there, in one form or another: photographs of every event, recordings of every interview, calendars and set-lists. As the tech-guy, Kyle put all of the data into that system.


Excel-lent Design

by in Feature Articles on

The user’s incident report did not contain the most useful description of the problem. “The calculator always outputs zero,” it said. Fortunately for Aram, he had a little bit of an idea of the context, and he knew that the issue was in the Customer/Regulation Administration Processor.

That name was a collective label for a suite of web applications, web services, and client pieces built around managing business process data for dangerous-goods regulation. The original design had been a bit of a mish-mash, and for the past year or so, Aram had heard that the core developers were gradually migrating it to a more SOA implementation.


Battleship Booleans

by in CodeSOD on

Barry’s first problem with the code was the use of magic numbers. If the application state variable held “127”, it then certain buttons would be enabled, but if it were “54”, then they should be disabled.

This led to all sorts of rules about combinations of magic numbers, some of which were more obscure than others. A huge library of methods arose to parse them out and derive simple true/false expressions based on combinations of magic numbers.


Psychic Code

by in Feature Articles on

Like snakes and mongooses , QA and developers are natural enemies. Through an unfortunate series of events, developer Bridget found herself working on a QA team. She was deep in enemy territory, and not full prepared for the rigors of QA, so she focused on her core developer skills. She helped the testers automate things.

“Well, we already have automated scripts,” her new co-worker, Jim, said. “We just… well, we only use them for really big regressions.”


Truth or Sim

by in Coded Smorgasbord on

A huge number of the bad code submitted to TDWTF is related to dates. This isn’t all that surprising- dates are very complex data structures with a vast number of possible representations and huge cultural variations.

I have no idea what the excuse is for all the bad code relating to booleans. Today, let's take a moment to explore some philosophy, and see if we can understand what truth really is.