Remy Porter

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

Apr 2013

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:


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:


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:


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.