|
Thanks, I will check it out. And yes I am actually re-writing a functional clone as you suggest. Sorry I did not make that clearer. The Program is around 400,000 lines of code.
|
|
|
|
|
Yeah, you'd need to re-think the database schema, what database approach to use, do you keep it as desktop or do you roll out parts of it as web apps, host it on the cloud (AWS/Azure), use SOA and componentize the application structure, using Web API wrapper layers, designing for scalability, etc. Sounds like a really fun project.
|
|
|
|
|
He isn't kidding. I would LOVE to get into a project like that!
|
|
|
|
|
Converted database schema to SqlServer years ago. The VB6 Code runs fine on SQLServer2016.
Using CodeTrigger to create the data access layers. Like it a lot.
Old men need love and respect too...
(Did not believe this when I was 25...
|
|
|
|
|
Exactly. Your post is the voice of experience talking.
Jeremy Falcon
|
|
|
|
|
|
Clearly, they never worked for a government agency.
On the other hand, you have different fingers. - Steven Wright
|
|
|
|
|
In the 1970s, when structured languages such as Pascal were becoming widespread, the saying was that "You can do FORTRAN programming in any language!"
|
|
|
|
|
Delete and rewrite?
Seriously - give that a thought: the logical flow is not the same in these two languages. I remember way back, when I was teaching myself C and how, after some time, I finally stopped writing FORTRAN programs with C syntax and started to write real C programs.
That goes for your conversion, too. Now, dropping that VB6, is your chance to finally do it right!
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Yes I am actually re-writing a functional clone as you suggest. Sorry I did not make that clearer. The Program is around 400,000 lines of code.
Can't delete, too many clients still successfully running their businesses with the VB6 code.
all out of aphorisms...
|
|
|
|
|
No real problem: let them keep doing what they're doing.
Meanwhile, you write and debug the replacement. Switch over the willing.
Note that, down the line, you'll have a much better chance of maintaining your (new) code.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Best Tool for me is ReSharper
Rules for the FOSW ![ ^]
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|
|
What might be useful, if it exists, is a tool that would let you embed C# in VB6 or vice versa allowing you to incrementally rebuild the app one module at a time. THis's dependent on the legacy apps structure not being too horrible; but at 400k lines and worked well enough to be kept alive this long I'm assuming that it did have more software engineering that the average craplication that earned VB6 so much hate over the years.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
I have been a firm believer in Rokford Lhotka's Business Objects....
|
|
|
|
|
Used Rocky's framework for years. Good stuff.
Mike
|
|
|
|
|
If all you're doing is converting it then what do you hope to gain? If you're not prepared to rewrite it just leave it as it is.
|
|
|
|
|
By "Converting" I meant re-writing while keeping all of the same functionality.
|
|
|
|
|
You clearly are looking to move to C#, but if you really want to shorten the learning curve, consider converting/rewriting to VB.NET. Once you get it to that point, there are tools that can convert to C#.
Why VB.NET first? The learning curve is much shorter and at least some VB6 code will work without too much fuss. (beware of the whole int/short/long issues)
If you want a direct conversion to VB.NET from VB6, I VB 2008 was the last IDE that had a migration tool.
"Go forth into the source" - Neal Morse
|
|
|
|
|
I understand your logic and agree to some point. But as someone who started in VB5, then moved to VB6, then moved to VB.Net (using your logic!!) and then finally to C#, I really wished I would have gone straight to C#. There's a good argument that VB6 and VB.Net are somewhat similar in syntax, but there are enough differences that you ARE learning a new language. So you might as well move to whichever language you actually want to learn.
While using VB.Net, I used to wonder about all the people ranting about it. I understand the lazy variable declaration issue, but if you just set Option Explicit then you're good. However, now that I use C# I understand their viewpoint, although I don't fully share it. But I would choose C# hands-down over VB.Net. It's a much nicer and more concise/readable language. VB.Net is too "wordy".
Just my opinion from my experience. Still, kmoorevs makes a good point.
Mike
|
|
|
|
|
I agree, go straight to C#. The jump from VB6 to VB.NET is not any different than jumping to C#, so cut out an unnecessary step.
Why go C#? Depending on which survey you read, C# has at least twice the market share of VB.NET. As a professional programmer/analyst I learned to focus on languages that would get me the next job. In job hunting I see a lot more C# reqs than VB.NET, so the surveys appear to have some validity.
|
|
|
|
|
Just want to second what Nish said. Also, to plug to our old friend Tom Archer who works at Microsoft, it may be worth getting his book [^]. It's a bit dated now, but in this case that's good.
It's a book that's specific about coming from a Visual Studio 6.0 world (from more of a C++ standpoint but still) to help with the fundamentals of C#. After the fundamentals, you can always read up on what's happened with the language lately... which has been a lot.
Jeremy Falcon
|
|
|
|
|
Given that Resharper has already been mentioned, what other tools would be useful?
Well, you might want to look into NDepend[^]. I use this tool a lot to check code quality; it's really useful for showing you dependencies and telling you the cost of those dependencies for instance.
Then there's unit testing (whether or not you are a fan of TDD, having well written unit tests is a real bonus). You can go with something like NUnit, the Visual Studio unit tests, xUnit or so on. Speaking of unit testing, as your code grows you might want to invest in NCrunch[^]. It's a great way to see if your code changes have broken any tests without you having to remember to run the tests yourself.
There are many other tools you can add as you grow, but I'd give these a look if I were you.
This space for rent
|
|
|
|
|
Is there an underlying reason to re-write beyond the fact that the code is out of date?
You may find, along with Nish's brilliant advice, that you could speed things up by wrapping the old functional parts into an API that can be called by the 'new' version.
That way you don't need to rewrite everything from day 1 to get moving. Wrap the API that can be called by the new solution and then you can replace the functionality piece meal rather than all at once.
veni bibi saltavi
|
|
|
|
|
As Balboos said, delete and rewrite. Anything in VB6 is going to look like an aborted fetus in C#. Not that it doesn't look like that already in VB6.
|
|
|
|
|
You mean "rewrite". Converting VB6 code to C# would mean using old COM-interfaces, where there's easier managed solutions available.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|