I and another programmer am working on the same program in Visual C#. I let him work on it, and then he uploads it and then I work on it, and then I upload it so that he can work on it. We take turns altering the source code.
However, this is kind of slow. It would be better if we were able to both work on the source code at the same time without takin开发者_如何学Gog turns, and then there was someway we could combine our changes easily. Is there a way to do that?
Source control... Take a look at Subversion with TortoiseSVN front-end.
http://en.wikipedia.org/wiki/Source_control
As Mike C. said, Source Control allow you to do that. Source Control creates a central place where code is stored, and allows teams to work simultaneously on the same code in a controlled way. When two programmers change the same file, the second one to check-in (upload their changes to the source control repository) is warned that another programmer has changed the same file and allows him/her to merge both changes if there are conflicts between them.
Other advantages are that it keeps a history of all changes made by every programmer so that you can trace who made what changes very easily.
This is why revision control systems came into existence. Now you NEED one. Take a look at the available softwares and pickone: http://en.wikipedia.org/wiki/List_of_revision_control_software
There's a lot of good free source control programs. I personally use Bazaar, very easy to work with and works with Windows well. Mercurial is also good, and so is Git by all accounts, though I haven't used that one myself. These three are all so-called distributed source control systems, which means you don't have to set up a central server. So for two guys it should be all you need.
However, if you want to opt for the central repository type of systems (check out/check in...,), both Subversion and Perforce are great. Perforce is a commercial system but for only 2 users the license is free. Although even using this type of workflow, you can adapt any of the distributed systems mentioned above to work this way.
As others have said, "source control" (also known as "SCM") is what you want; in fact, what you wrote:
both work on the source code at the same time without taking turns, and then there was someway we could combine our changes easily
...is pretty much the definition of source control. (There's one additional major feature of SCM, which is history tracking, as Andres mentioned.)
Subversion is definitely the product you should be trying out. It's well documented, modern (ie: none of the "older" issues of CVS) and relatively simple compared to more powerful distributed systems like Git.
One important note: "combining our changes easily" is something that takes some dedicated learning and practice. "Merging" is the practice of taking code from two different sources and unifying them in a way that doesn't break things. It can be tricky and is quite confusing until you gain a deeper understanding of how it works. I'd recommend setting aside a day with your partner dev and practice doing dress-rehersals of combining your changes before you try doing it on real code. Again: Subversion is a great tool here because the documentation is very good and clearly written.
As stated above, you really need to look into a source control system. Subversion may be the easiest for you, and you can elect to get another company to host it for you depending on your requirements. Use Ankhsvn or VisualSVN inside Visual Studio or TortoiseSVN as suggested.
If this project is opensource you can host it on Google Code or Github otherwise take a look at Assembla if you are unable to setup a boxen to host your repository. With Assembla you also get a copy of Trac which will give you a project management system as well (though I've used Trac for the past 3 years now, I've since moved onto Redmine). But there are other tools like Jira + Confluence etc once you have a source repository setup.
Please stay away from Visual Source Safe. Team Foundation Server is another you have to really think hard and determine whether you'll need the whole-shebag before going in for it.
If you go with TortoiseSVN, install WinMerge which will automatically be registered as the Diff tool, gives you a bit more oomph when doing some complex merging :-)
精彩评论