Thursday, February 23, 2006

Other Peoples Programs

Programmers have always had a hard time with OPP. Its never the way you want it, and there is this primal urge to rewrite. And yet of course most programs in the world work, do what their programmers wrote them to do, and will work better if left alone than if rewritten.

But there's always the exception, which I've battled all this week. If a program is so badly written that you can't use it, what use is it? Will rewriting fix it. My program de jour was a Cheque Audit report which only shows the transactions that it likes, not the transactions it thinks are wrong.

This is the problem with SQL in some ways. Its great to be able to join 7 different tables together and toss in some neat critiera and get back piles and piles of data, but I think its a bit wierd to put that into a curosr and then omit entries you really don't want. Because the join also implicitly rejects anything that isn't part of the join. So if you don't see a record, is it because it wasn't in the driving SQL or at the rejection point?

So I gave up in the end and left the program alone. I've written an audit report which audits the data underlying the report on the assumption that when the data is wrong the original report doesn't work, but when it's right it's fine. We'll see.

No comments: