Recently, a question came up on an online forum about whether to upgrade from Visual FoxPro 6.0 to 9.0. In talking about their last upgrade, the poster said, “The upgrade was enough of a step – we still use basically 3.0 code so things like grids are not used… I know it is old fashioned, but with over 3,000 programs to change it will be awhile before we do another upgrade.” The question was whether or not to upgrade to VFP 9.0.
Well, there’s a long and short answer here.
The short answer is that I recommend you do NOT upgrade.
The long answer takes a bit more explanation. If you are still using 3.0 code, there is a very good chance the enhanced syntax checkers will flag a lot of your code in need of changes. The improvement (and it really is an improvement) in the SQL statement processing to prevent non-aggregated fields in SQL Select statements with GROUP BY will take you weeks to address. Code References and IntelliSense make development easier, but not that much easier if you’re supporting a legacy code base. New coding features would be a huge boon, but only if you plan on writing new code. If, as you claim, you are supporting 3,000 programs in 3.0 code, there’s little point to using new runtimes. Speed and stability might improve a little, and bugs would be fewer, or at least different, but unless your company is willing to commit a serious effort to upgrading, getting 3.0 code to run in a 9.0 runtime is just make-work, with little benefit to the business.
I speak from experience. I support a number of clients with legacy applications, some written over 15 years or more. It’s a huge effort to keep them running without a rewrite. The right way to do it, had it been done from the beginning, would have been to continually invest in rewriting and improving the application, adding new features while overhauling older ones in order to keep the application fresh. Code really does rot if left alone. The state of the art and the best practices are an evolving target, requiring regular updating. It’s also a large effort to do a rewrite, but I’ve successfully moved a few apps from the DOS days to a good code base.
Does your 3.0-version application have a web component? PDF output? The ability to automate office documents for interactivity? Supply an EIS in Excel? Use Web services to communicate with customers and vendors? Sport an RSS feed? How about an object-oriented error handler? A data handling framework that allows switching to a client-server architecture as needed? An application that has been preoperly designed and properly nourished can be extended to do all these things. One that has been left on a subsistence diet, fed the minimal amount of programmer attention to keep it running, keep bugs to a minimum, has run its course. It is old, rigid, fragile and moribund.
I have worked on world-class applications and few if any of them need three thousand separate programs. Is there any chance that your code repeats itself in more than one place? Knowing that one metric screams to me “Refactor!” – you need a class hierarchy, business objects, data handlers, interface objects, factories, drivers, patterns, strategies – a huge undertaking, to try to slip a foundation under the existing house of cards. If you are running 3.0 code, this undertaking is starting 10 years too late. You are a decade behind the times. If you are running 6.0 runtime now, you’re still five years behind. Don’t bother.
I’d see two choices:
1. Buy VFP 9.0 and a good commercial framework or two to base a new generation application on. Create a new application that matches or exceeds the functionality of the old one.
2. Wait for Ken Levy’s June 1 Roadmap and decide if you’re going to want to rewrite in .NET or LAMP.
Clients get to the point where they have gotten away with minimal reinvestment in their legacy app for a decade or more, and then demand that it turn on a dime to meet some new need of the business or demanded by a customer. They are typically very indignant when told that it’s either difficult or impossible for the application to make the transition, and that the budget for the change is five, or more likely six figures USD. In the meantime, the client has kept an office of people paid, gotten their kids through school and bought a summer house on the back of this application and his underpaid and underappreciated staff.