3 ms·
For every absolute rule there must be an exception somewhere... ;-) Several years ago I was the tech & operations dude for a little organic grocery store. They
by thaumaturgy 18y ago
For every absolute rule there must be an exception somewhere... ;-)
Several years ago I was the tech & operations dude for a little organic grocery store. They were good people, with not a lot of money to throw around, so the cheap & quick fix-it-now solution was always pretty attractive.
Well, one of the things they needed was a program that would take two input files -- one a current list of products' wholesale costs, and the other a current list of what was in their point-of-sale database and their retail prices -- and produce a report containing all the price changes they needed to make that week.
VBScript will make most programmers' blood run cold, but it was a good way to solve that problem at the time. Zero initial cost, simple to hack out, ran on their aging Windows point-of-sale server, etc. So that's what I did.
Then the boss came back and said, "This is really cool. Can you make it do X?" And I said, "Sure", and that process repeated for almost two years.
The VBScript program long since got pushed beyond all of the boundaries that any programmer with any good sense would ever push it, and they're still using it today. I have gently refused to update the program any further, or to fix any of the odd bugs it exhibits occasionally, mostly because updating the program is now too expensive.
It really does need to be rewritten from scratch in something more useful, like Python, with a clearer idea of all of the features that they'll want in the end.
I think my point is, sometimes you start with something simple, and use the methods that make sense at the time, and then it grows beyond the limits of its actual architecture. It's often impossible in a situation like that to just refactor portions of the code in a useful way. So, then it might be time to (carefully) consider rewriting the whole mess. You have the benefit of having a clearer idea of what you need to create, right from the beginning, and you can avoid the architectural mistakes that were made with the first system.