best way to copy most of another program

razz

Well-known member
Joined
Oct 11, 2008
Messages
67
Programming Experience
Beginner
I wish to create a program that is, with few exceptions, exactly like another program I created. The current version has a fair amount of text explaining things, the next version (a Pro version so to speak) would do all the same things, same buttons etc. but have a lot less text.

What would be the best way for me to accomplish this? I was hoping to just use the old program and edit most of the text out. But then how can I save the new version under another name and not screw up any files belonging to the old version?
 
Use Windows Explorer to copy the main project/solution folder, open the copy in VS and use IDE to make other changes.
 
I would suggest that you only have one project. If you create two projects then any changes you need to make, like bug fixes, will have to be made to both.

A better way to do this is generally with build configurations and conditional compilation. By default you already have two build configurations: Debug and Release. You can have code only compile into one or the other using conditional compilation:
VB.NET:
#If DEBUG Then
        'Code here will only be compiled in a Debug build.
#Else
        'Code here will only be compiled in a Release build.
#End If
The Debug configuration defines the DEBUG constant by default, while the Release configuration doesn't. You can define as many additional configurations as you want. You might define a Debug Pro configuration and a Release Pro configuration, each of which could define a PRO constant. You could then do this:
VB.NET:
#If PRO Then
        'Code here will only be compiled in a Debug Pro or Release Pro build.
#Else
        'Code here will only be compiled in a Debug or Release build.
#End If
 
Conditional compilation could result in a lot of code that was previously done in Designer. If you had to choose one approach or the other there would be a balance between maintaining two application sets and the amount of extra code to write (with readability/design considerations). With "duplicate" projects you can still share common classes by adding them to a Class Library project that both the app projects uses. By putting all projects in one Solution you have the development for both projects collected in one place, you can in this case select which projects outputs for different build configurations and which project is the startup project for debug/deployment.
 
Conditional compilation could result in a lot of code that was previously done in Designer. If you had to choose one approach or the other there would be a balance between maintaining two application sets and the amount of extra code to write (with readability/design considerations). With "duplicate" projects you can still share common classes by adding them to a Class Library project that both the app projects uses. By putting all projects in one Solution you have the development for both projects collected in one place, you can in this case select which projects outputs for different build configurations and which project is the startup project for debug/deployment.
That is all certainly true, which is why I said "generally". If the differences were mainly in the UI, and therefore created in the designer, then the idea of two similar application projects using common DLLs is definitely a good idea. That would mean that your UI would have to be for nothing other than display, which is something that very few people actually ever implement.
 
That would mean that your UI would have to be for nothing other than display, which is something that very few people actually ever implement.
I've witnessed this at both my jobs, the UI and main processing are directly tied together.
 
Back
Top