Alex Rivera | Logout

What's the most unsound program you've had to maintain?

Asked 2008-10-18T10:03:36.093
24

I periodically am called upon to do maintenance work on a system that was built by a real rocket surgeon. There's so much wrong with it that it's hard to know where to start.

No, wait, I'll start at the beginning: in the early days of the project, the designer was told that the system would need to scale, and he'd read that a source of scalability problems was traffic between the application and database servers, so he made sure to minimize this traffic. How? By putting all of the application logic in SQL Server stored procedures.

Seriously. The great bulk of the application functions by the HTML front end formulating XML messages. When the middle tier receives an XML message, it uses the document element's tag name as the name of the stored procedure it should call, and calls the SP, passing it the entire XML message as a parameter. It takes the XML message that the SP returns and returns it directly back to the front end. There is no other logic in the application tier.

(There was some code in the middle tier to validate the incoming XML messages against a library of schemas. But I removed it, after ascertaining that 1) only a small handful of messages had corresponding schemas, 2) the messages didn't actually conform to these schemas, and 3) after validating the messages, if any errors were encountered, the method discarded them. "This fuse box is a real time-saver - it comes from the factory with pennies pre-installed!")

I've seen software that does the wrong thing before. Lots of it. I've written quite a bit. But I've never seen anything like the steely-eyed determination to do the wrong thing, at every possible turn, that's embodied in the design and programming of this system.

Well, at least he went with what he knew, right? Um. Apparently, what he knew was Access. And he didn't really understand Access. Or databases.

Here's a common pattern in t

Edit
Report

1 Answer

0

Anything I've ever written that's originally supposed to be a quick prototype and ends up staying around a while. My problem domain requires a lot of throwaway prototyping by its nature. For these prototypes, it's sometimes reasonable to violate every best practice and rule of good style, just get it done and clean up later if the prototype ends up being worth keeping. However, occasionally these prototypes end up being very difficult to get working properly, but then end up being keepers. In these cases, I usually end up putting off refactoring/rewriting the thing indefinitely because I'm afraid I'll never get it working again. Further lessening my motivation is that my boss is a domain expert who doesn't program at all.

answered 2008-11-22T02:31:17.253

Your Answer