Recent Articles

Aug 2010

Fast Fix

by in Feature Articles on

"Do you think it's wise to have consultants running our IT department?" Holger asked. It was an honest question, worded as diplomatically as possible. Holger's company had more consultants on hand than actual IT staff.

"Holger, these folks are experts," his manager replied. "It isn't cost effective to hire-on this level of expertise full time. We may pay a little more up front, but when we don't need the consultants anymore, we can hand it off to our internal people."


Command 696

by in CodeSOD on

Think of all those old applications you’ve had to maintain. You know the type: the ones written by long-forgotten developers in long-lost languages. The ones that, after spending days searching for that one line of code that needs to be changed, you frustratingly decree “this f%*#@ thing needs to be rewritten.” And, naturally, the ones that never are, nor never will be rewritten.

Call it luck or persistence, but after dozens and dozens of maintenance requests over the years, Israel Brewster finally was given the opportunity to rewrite an application. From scratch. And the right way, this time. No shoddy VB6 front-end; no horribly-designed SQL Server 2000 (only) database; and certainly no Microsoft Access-based administration tool.


There is No Survey Currently Running

by in Error'd on

Kristján writes, "I agree. No, wait..."


Stoned!

by in Feature Articles on

When Greg was shopping for jobs at his college’s career fair, there was a whole lot of business as usual.

The larger banks were on-hand looking to swoon the upcoming Financial grads. Several representatives from a few big name manufacturing corporations were there to interview the Chemistry majors and a few IT firms were on the lookout for the soon-to-be CS grads, like Greg, to add to their ranks. However, amid the ocean of pamphlets and  suits there was one aerospace corporation with one particular position that caught Greg’s attention. The position that he applied and was ultimately hired for could be summed up in one sentence:


Masquerading as a Loop

by in CodeSOD on

"While digging through some inherited code," writes Joe "M2tM" Smith, "I encountered a conditional masquerading as a loop."

"Thankfully, the fellow responsible is 'no longer with us', and I suppose this type of code stands as silent testament to why. This interesting loop is only created so the break keyword can be used as an elaborate GOTO."


Large Blockage

by in Feature Articles on

The words "Enterprise Integration" strike fear into the most stalwart of developers. When coupled with "in-house developed" and "B2B", one is almost guaranteed to find complex code, arcane requirements, and a thicket of poorly understood file formats. Dan was made of sterner stuff. When the contract was explained to him, he didn't flinch. There were between 40 and 80 partners that used a web app to extract data about multimedia assets? Gigantic recordsets of them? In formats ranging from Excel to iTunes-compatible databases? No problem.

Steve, the project manager, explained: "Our original lead developer was one of those rockstar types. Real cutting edge, pushing the envelope type guy. He's since moved on to bigger and better things, so we've just muddled on the best we could. We really need you to step up and take on that rockstar role for us, because there are a few problems we'd like you to fix. And we need a real quick turn-around on this."


Swallowed by the Beast

by in CodeSOD on

Paul was having a good morning.  It was a beautiful day outside, he managed to shave 15 minutes off his commute, and even the local coffee shop had his favorite donut in stock.  All of that changed when he got his first support call of the day.  It was from a client running "the beast" product.  "The beast", as Paul and his coworkers nicknamed it, was a legacy version of their application developed somewhere overseas years before Paul was hired, by hundreds of poorly trained, and probably poorly paid, developers.  The company's sales team actively encouraged clients to upgrade from the legacy application, but a select few had resisted.

"The beast" had a reputation for containing some of the worst code Paul had ever seen and every time he had to support it, he felt like he needed a shower afterwards.  It was during his fourth hour of debugging that Paul came across a previously unvisited function shown below. 


Logon-ing Off

by in Error'd on

Andrew Carpenter writes, "I guess this is like turn-oning off a switch?"


Is Your PC Frozen?

by in Feature Articles on

Bob was in the process of shutting down a software company that he had built over the past seven years. He had found a buyer for all of the software that he'd developed, collected his "eff you money" and was now retiring.

In fact, things were at the point where Bob had already closed the building and redirected the phones to his home phone with a distinctive ring so that he could tie up loose ends while the building was up for sale.


Avoiding Magic Constants

by in CodeSOD on

Everyone knows that "Magic Numbers" are bad, Bad, BAD! Take, for example, dividing something into quarters. Because including the literal "4" in your code would be a Magic Number, many developers agree that it's best to define a constant named "FOUR", and then use that constant instead. Makes sense, right?

Wrong! The problem with using "FOUR" is that, like "4", it's a Magic Constant. While not nearly as bad as Magic Numbers, Magic Constants certainly aren't elegant. Fortunately, Allen's colleague has provided us all with a valuable lesson the proper use of Magic and Non-Magic constants. Read it, and learn.


Powerful Stupidity

by in Feature Articles on

Everything went dark and a chill wind went up Simon's back. A deep rumble rattled his brain in his skull. He glanced behind him to see Noel looming over him. "Simon, can you ping the Exchange server?"

When the trained bear that doubles as your IT manager asks that question, it's a bad thing. Simon tried to ping Exchange and failed. He then tried to ping an app server. And a database. And the outside world. All dead.


Role-based Canary

by in CodeSOD on

Role-based security requires, at a minimum, two key elements: users and roles. Roles (such as Administrator, Clerk, and ViewOnlyUser) are defined by the application code and then assigned to users to restrict which functions of the application they may use. It's a pretty simple concept that involves all of two database tables, or one if the user names come from some external source like Active Directory.

In Adam's case, the Role-based security feature served as a coalmine canary in the application he was tasked with reviewing. Although it passed all of the test cases — employees could only do certain things, customers could do other things, etc. — there was one fundamental flaw with the system. See if you can spot it.


Existential Philosophy

by in Error'd on

"I got this elegant statement of existential philosophy from Microsoft's Process Monitor utility," Matthew wrote, "It died while trying to start up, so yes indeed, for a few shining moments, the application was."


Production Promote

by in Feature Articles on

"John, it's about time I showed you how to do a production install," Dave said.

John had only been at the job for a few weeks, and was still learning the ins-and-outs of their shop. It was a small team, with the stereotypical alpha-geek at the top, people like Dave in the middle, and John at the bottom. They lived to support a complex pile of applications that all existed to extend or manage their flagship application.


Boolean Illogic

by in Representative Line on

One of the great things about Boolean logic is its simplicity. At the most basic level, there's simply TRUE and FALSE with AND, OR, and NOT. It takes a lot of work to overcomplicate such a simple system, yet "certain" developers seem to find such over-complication second nature. Take E.H.'s colleague, for example.

His impressive use of interesting semantic choices, redundant equality checks, and integer mixing make every line of code seem like a puzzle to solve. Take this line, for example.


Tables Turned

by in Feature Articles on

Bert Glanstron, Greg thought to himself, why does that name sound so familiar? Bert… Glanstron… did I work with him? Did he go to my high school?

Saying the name a few more times didn’t help jog Greg’s memory, so he shrugged his shoulders and double-clicked on the résumé. It was the eleventh in a row he had reviewed for a programmer analyst position, and it somehow was even less impressive than the previous.


The Arralphalet

by in CodeSOD on

James sent in today's snippet with virtually no introduction; just six, measly words: "the grass is definitely not greener." Normally, that'd be a bit frustrating, since it's always nice to know a little history or background about the code. But like those six word stories, James told the classic tale of the young and burgeoning software developer who’s always looking to expand his professional purview by seeking out new opportunities to learn and sharpen his skills, only to find his efforts frustrated by a “seemed good on paper” job that leads to nowhere – or worse – towards destitute and despair.

Well, either that, or this code really speaks for itself. Maybe it's the generic Util class which acts as a dump for random methods. Perhaps it's the alphabet array with an extra Z. Or it could be that method for turning letters into numbers.


Nothing to See Here

by in Error'd on

Alex G. writes, "This is what my GPS had to say when I was trying to find a lookout in Cabris in the South of France."


Best of the Email: Aloe Vera, The Cables that Store the Internet, and more!

by in Feature Articles on

It's baaaaaack...yep it's THAT time again.  It's Share Your Bizarre Email day!


"This one by far is the greatest email I have ever received," wrote Kelly, "Apparently, corporate IT support is the great know it all!"


Try... Catch-em-all

by in CodeSOD on

"Recently, I inherited an ASP.NET web application that hadn't been touched in many a year," wrote Scott Schottler, "I was pleasantly surprised to see that, not only did it successfully convert from a Visual Studio 2003 project, but that it actually built without errors."

"Of course, my excitement soon waned when I looked into the code. Now we've all seen the Try-Catch-Gulp pattern, but this is ridiculous."


We Use BobX

by in Feature Articles on

Christian’s first day at his new job started out just like many others in the professional IT world.

“Welcome aboard!” exclaimed Brian with an outstretched hand, “Great to see you again, c’mon in and we’ll get you all set up.”


Uncovering Nothing

by in CodeSOD on

Remi works on one of his country's largest Internet Service Providers, and has the fortune to be on an elite team that focuses on agile development. Or misfortune, depending on how you look at it: at his company, "agile development" actually means "we need that in two weeks".

One of Remi's first assignments was to fix an "emergency" on one of the ATM Addressing systems. Apparently, the application was coming up with incorrect routing data. After a solid day-and-a-half of digging through Visual Basic code that called SQL Server stored procedures which called VB-based COM objects which called more stored procs, Remi found a weird table ("Cal_ATM") that was referenced from an externally-linked database, and the data in that table was completely out of date.