views:

331

answers:

8

I am a very new programmer, I have made a couple basic applications, however I was told that it would be good to get used to using "source control" at the near the beginning of learning so I get accustomed to it. I have gathered that source control is what is used to manage programs with multiple programmers and that it is somehow connected directly to my projects in Visual studio. I also believe there are two primary versions, "TFS" and "SVN". Past that I am fairly lost, I am not sure what I need to actually implement this, specifically how I would do so on my personal projects. Also I don't know what program(s) are needed.

Should I use TFS or SVN? What program(s) do I need to install? How do I implement them in Visual Studio? Is it a good habit to get into for my personal programming or would you disagree?

+3  A: 

The source control system is separate from your IDE. You can use it from the command line, or from a graphical client as well as from your IDE.

What you should know about a source control system is this:

  • you save your increment changes to the SCM (source code management), and each save receives an unique id/revision
  • you can retrieve any revision on any time, therefore changes are never lost
  • this gives you the liberty to delete unused code, debug info, or to refactor existing functionalities
  • and most importantly, it gives these functionalities to all members of a team, so that the team can work at the same time on the same code base, from their own development machines

You could start with svn, as it's very popular (especially for open source projects) with widespread support. You can gen the command line client from here:

http://subversion.tigris.org/

This is a nice graphical interface (windows):

http://tortoisesvn.net/

This is a free book to help you start with svn:

http://svnbook.red-bean.com/

If you need to setup a server on your development machine, this tutorial should help:

http://blogs.vertigosoftware.com/teamsystem/archive/2006/01/16/Setting_up_a_Subversion_Server_under_Windows.aspx

Mercer Traieste
+8  A: 

Please go ahead and open up wikipedia, you have a bit of reading to do:

  1. Revision control
  2. Subversion

With that reading done, you should have a better understand of what source control is. As a programmer, I'm pretty sure you'll find it makes sense to "save" what you're working on, making changes incrementally and being able to go back to those changes.

In a nutshell, revision control is the ability to go back in time, so that you can read code you have written at that moment.

tomzx
+4  A: 

Ok first there are many source control products other than the two you have mentioned but I would get used to SVN first.

TFS is expensive and tied into the Microsoft stack.

I'd start with reading this:

http://svnbook.red-bean.com/

Specifically the chapter on fundamental concepts

Yes this book is tied in to svn but it covers the basics too.

When you have read that download TortoiseSVN. This is an svn client that hooks into your windows shell. Only when you are comfortable with using this would I then move on to an integrated svn client. (I actually don't use one) AknhSVN is free.

John Nolan
+1  A: 

Hi Erik, there are many different source control providers including TFS, Subversion (SVN), Perforce, CVS and Visual Source Safe to name but a few. It is also one of those areas that people tend to get semi-religous on, so I'll tread carefully!

I think most people would agree that Visual Source Safe is not the way to. It is fairly simple as a source control system but would do little to teach you about source control in general. TFS, SVN and Perforce tend to get pretty good feedback from their users.

Out of these, SVN is the only one that is free, so if you are planning to do this as a learning exercise, I'd be inclined to start there [actually I believe you can get a free 2 user license for Perforce too, but I'm not 100% sure on that). You can learn all the basics with this, as well as more advanced areas such as branching and merging.

If you do give it a go, I recommend you download SVN itself, and the TortoiseSVN client for Windows Explorer (I'm assuming you are on Windows here as you mention Visual Studio). You may also want to look at source control integration into Visual Studio, in which case I use VisualSVN (there is a free trial), but there is another popular one whose name eludes me (someone will hopefully add it as a comment).

Additionally there is a great, free, e-book for SVN, available (here)

Overall - to answer your specific questions:

Should I use TFS or SVN?

SVN

What program(s) do I need to install?

SVN itself (the server) and TortoiseSVN

How do I implement them in Visual Studio?

Use VisualSVN or another SVN for Visual Studio client. You don't need this to learn source control, but it is well worth trying it out from in the IDE.

Is it a good habit to get into for my personal programming or would you disagree?

Yes, definitely!

Good luck, and hope you enjoy getting into source control.

Rob Levine
Reading one of the other answers - the other client for SVN in Visual Studio is AnkhSVN (http://ankhsvn.open.collab.net/), which is free. Haven't used it myself, so can't really comment on it.
Rob Levine
Would have been +1 for 1st paragraph, but then don't follow up.
Richard
A: 

Of the source control systems I've used Subversion with Tortoise is my preferred choice (I've used VSS, Subversion (SVN) and TFS).

Subversion has some excellent documentation on how it works and also on the general concepts of version control so that you actually understand what you are doind and why.

If you want to set up Subversion on a Windows stack then by far the easiest way is with VisualSVN which is free. The client side plug in to Visual Studio, however, is not free. But there are many free alternatives such as Tortoise.

Colin Mackay
+2  A: 

check out Git and think about hosting your projects on https://github.com/ - also, check out linus talk on git: http://www.youtube.com/watch?v=4XpnKHJAok8

raoulsson
I suggest that a talk where Linus insults (some of) his audience is not the best introduction to version control.
Greg Hewgill
You are probably right, yes. But if someone starts fresh, I think it is a great chance to choose a "better tool" right from the beginning.
raoulsson
Git does not currently hook into Visual Studio... which was one of the OP criteria.
Jeff Fritz
A: 

You should not usually host your own subversion/git/whatever server. It is time consuming and error prone. For small projects subversion and git hosting can be found for free, and give you offsite backup, the ability to work from anywhere and the ability to add offsite programmers to a project with ease. If your needs grow, you can pay a small monthly fee.

You can use a google search to find candidates. The one I use is http://unfuddle.com.

Tom Andersen
I respectfully disagree that hosting your own git repository is time consuming or error prone. I find it quite easy with git. In fact, as far as I know it's the only way to use git. If your source control system isn't as easy to use as git, perhaps your source control system has bugs that should be fixed.Your point about working from anywhere and backups is good, though.
Noah Lavine
A: 

I found this article to be very clear. (It recommends SVN).

UpTheCreek