0

Let's assume you have a windows form that allows you to input your name in a textbox, you press a button and pops up a message box with your name. Now, lets assume that a user come forward and want another textbox to print their surname. You determine that this feature will require months to develop (I'm exaggerating on purpose but please bear the concept).

Hence, you do not want to amend the existing form because otherwise you cannot release your product until the new feature is completed. My approach to such scenario is to make a copy and paste of the form, implement the changes, test them and when ready the old form is replaced with the latest version.

This approach has the major draw back that any quick fixes to the old form need to be replicated in the new form as well and thus resulting in duplication of effort. Apart from the fact that I hate copy-and-pasting; this just doesn't feel right.

Another approach would be to create a class that inherits the original form and hence any bug fix to the "old" form is automatically available to the new form. This approach gives you the flexibility to develop in this "new" form while allowing you for issue bug-fixes on the old.

However, I'm not convinced this is the right approach. Do you have an alternative and better approach to this scenario?

CodeCaster
  • 147,647
  • 23
  • 218
  • 272
deadCrow
  • 31
  • 1
  • 1
  • 5

1 Answers1

1

Sounds like what you want is a version management subsystem. Look into Git, SVN or others. These allow you to work on several 'versions' of the program at once, make changes, merge those changes, etc.

As mentioned in the comments, a document on Git describing the possible workflows using branches might get you started. For Tortoise/Mercurial, this SO question might answer your question.

Community
  • 1
  • 1
MicroVirus
  • 5,324
  • 2
  • 28
  • 53
  • No no, I use mercurial versioning control. Not an issue. I need an approach that allows you to amend the original form (for bug fixes) whilst allow you to work on a new feature of the same form WITHOUT code duplication and in tandem. I'm sure you all have had this type scenario in you have been in this business :))) – deadCrow Jul 03 '15 at 09:44
  • What @CodeCaster said: if you are already using version control then you are not using it to its full potential; in fact, then you're not using it for its primary goal. Look into branching; it's the tool to handle your proposed case. – MicroVirus Jul 03 '15 at 09:47
  • Sounds interesting concept.. I wonder if Tortoise/Mercurial have "Feature branches". It does have branches but it does / handles everything automatically for you. I've never seen an option "create feature branch" in Tortoise, but I have seen those branches and which then merging code from different developers. Your suggestion could be a very good alternative to the existing 'scrappy' methodology we have! – deadCrow Jul 03 '15 at 10:00
  • @deadCrow "branch by feature" is a principle, a way of using branches. You won't find the option "feature branch" in your source control client. – CodeCaster Jul 03 '15 at 10:04