Remy Porter

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

Aug 2012

Healthy Competition

by in Feature Articles on

“This one’s going to be a little different,” Tom said.

Rich agreed, although for the wrong reasons. He thought it was going to be different because this was their first really big contract. Rich worked for Tom at a “new media” company young enough to have that “new company” smell. They had just landed a contract with Initrode to add some major features to their website.


Data? Data data. Data.

by in CodeSOD on

It's natural for a development team to spread the work out. Each member writes small modules, and then the modules are all assembled to implement the business functions the software requires. Sometimes, each developer has a distinct touch and style, and you can tell, just by naming conventions, who was responsible for which block of code. And sometimes, you get blocks like this.

  var srcData = data;
  if (data.data && data.data.data) {
      data = data.data.data;
  } else if (data.data) {
      data = data.data;
  }

  if (!data) {
      return;
  }
Data, data. Data data? Data. Data! Data data data, data data… data.

Can of RAID

by in Feature Articles on

"The rent must be cheap," Alex mused as he pulled into the muddy field that served as a parking lot. He guided his car into a spot beside another car, which happened to be up on blocks. The building he was here to visit was a double-wide trailer that had started rotting before Alex was born and didn't intend to stop until well after he was dead.

It wasn't a very nice office. Alex was there because his employer owned it, and the handful of employees located at this site depended on its local RAID for file storage. Sometime over the weekend, the RAID failed, and now he needed to fix it.


Globally Fiscal Year

by in CodeSOD on

It's easier to teach a non-programmer to program in an object oriented language than it is to teach a Cobol programmer to do the same. That's my experience, and I think Clint would agree. He sent in this VB6 block that he inherited, developed by a self-proclaimed Cobol fanatic. There's not a lot code here, but nearly every line has something… special.


            

GUGUID

by in CodeSOD on

GUIDs are unique, but are they unique enough? There is, of course, a slim chance of a collision. Sure, you're more likely to be struck by a meteor and lighting while winning the lottery on a Tuesday during Lent while driving your Ferrari to the diner for pancakes, but it can happen!


Refresh Your Virus Scanner

by in Feature Articles on

Timmy threw open the door to the team room. Panting, he cried, "We're being hacked!"

Blair and the rest of the team slouched into action. They knew the web server was down, but that was hardly unusual. The "web server" was Blair's desktop from five years ago, reformatted and turned into a host for their home-grow project-management software. It dwelled under his desk, away from the light, and was not generally considered mission critical. The fact that it was down, again, didn't rate a high slot on anyone's priority list.


Common Functions, not Common Sense

by in CodeSOD on
Ben inherited a an application from a fellow employee on the fast track to retirement. How fast? Well, these are some sample methods in a thousands-of-lines-long class file called, appropriately, "Functions".
	public static string ReturnEmptyStringIfNullElseValue(string value)
		{
			if (value == null)
			{
				return "";
			}
			else
			{
				return value.ToString().Trim();
			}
		}

That isn't the worst, most useless block of code possible. Neither was his method to turn strings into ints.


The Long Goodbye

by in Feature Articles on

Herwig smiled at Greta as he entered the glass-walled copy-center. "Excuse me, but do you mind if I ask you a few questions?"

Greta smiled back. Over the past week, they'd certainly seen enough of each other. "Of course not."