views:

661

answers:

17

For example, if I was doing a project at home, does it make sense to use version control in the event that I want to revert or whatever, or does the shadow copy feature of Vista (we'll assume I'm using Vista) accomplish the same thing?

+1  A: 

Yes it does make sense to use version control (I use Subversion), because you can always backtrack on your earlier code. It helps you become more organised, and in the event that others join you to form the dev team, at least it won't be hard to adjust ;)

cruizer
Those are some great points.
MrBoJangles
+16  A: 

Absolutely. Even if you use it as a basic undo-redo system with logging and annotations, it's a powerful tool that will make your life easier. Once you add in DVCS features like fast branching and inter-repository merging, it becomes indispensable. All of my projects that are intended for more than one-off scripts are checked into version control.

John Millikin
+1  A: 

Definitely! The ability to rollback and to see the changes since the last commit is priceless.

Alexander Kojevnikov
+1  A: 

For projects I work on at home, I usually find that I do okay by keeping a copy of the code I'm working on in a separate folder (especially before I anticipate a big change). This allows me to go back to an older version if I want to revert - but usually, I don't find myself reverting my own code.

Just make sure to ALWAYS BACKUP YOUR CODE!

David
+1  A: 

I use version control for every project that I do. It's like a net to catch your mistakes. If you screw up your project directory, you can restore from VC. Change something that you decide that you don't like days later? Restore from VC.

I find that when I am coding without a copy under VC, I am much more afraid to make changes, and a single backup directory wouldn't provide me with the same level of security. Sometimes, I hit a dead end weeks after making the decision and have to backtrack.

I've also found it helpful to be able to look at a line of code and ask myself, "What was I thinking when I did that?!?", VC allows me to answer that question. This is doubly important for projects that you aren't spending a lot of time on.

jpollock
+2  A: 

Absolutely. I use SVN for all my freelance work. It's saved my butt more times than I can remember. It's not unheard of that I have to revisit a change I made in the past because it broke something obscure that wasn't picked up for ages.

Also if you use a remote SVN server ( see here & here for suggestions of services) it gives you the added benefit of an off-site backup

Glenn Slaven
+8  A: 

Absolutely! You will have history you can refer to and fall back on if needed. You can tag revisions and releases for reference. You can branch for testing ideas, etc.

I used a VCS for years before working in a team environment, it saved my butt more than once. I use one for my school work (even classes) even when they are programming related, because I can track changes and have a central place for storage that can be reached from more than one computer if needed.

I doubt shallow copy gives you the control and flexibility of something like SVN. Further, I keep my personal and work VCS on different boxes, so there is a built-in redundant copy of my work.

Joe Skora
So many good answers worthy of accepted status, but I had to pick one.
MrBoJangles
+1  A: 

You may also even want to consider hosting your project if you think it will take on a life of its own. Tracking and prioritizing bugs and/or features might be a nice feature you get with a sourceforge or googlecode or github whatever.

Nathan Feger
+6  A: 

You can develop without version control? That's like breathing without oxygen!

Yes, it makes a lot of sense to use version control when you're a solo developer. Version control isn't just about stopping a team members from stomping on each others' toes, it's about having a way to track your changes, and to remove, revert, modify, or adjust the ones that don't work.

As a classic example, let's say you've developed some code that works perfectly, but it's a bit slow. You rewrite the code, build your system ,and "ship it". However you discover that your new code has a subtle big with dire effects when it occurs. Wouldn't you love the opportunity to just plug back in your old code, but keep all the other improvements and bug-fixes from your other changes?

On a higher level, let's pretend you write a test case to ensure a particular bug is fixed. Wouldn't you like to go back to a previous version of your codebase that contains that bug, and be sure that your test picks it up properly? I would!

If you're using version control properly, you should be able to do all these things. Your need to have a public/team-visible system isn't there, but all the other needs of version control are there.

Personally, I use git for solo revision control. It's fast, the repository lives in the same directory as my code (so there's no special setup with servers), and it's easy for me to push the code out somewhere if I do need to start sharing my source control history. Of course, your tool of choice may vary, but you do want one, even for a solo project.

All the best,

Paul

pjf
+4  A: 

Another really good use of source control is multiple machines. I have two machines, one a laptop and the other a desktop. The majority of my development is done on the laptop, because I'm rarely at home; but, when I'm at home, the home desktop is much faster. Using source control with this system makes for a very robust syncing mechanism; it also means that I have a backup of the current version of my code on two machines.

I have the server on my laptop, just so that I can check things out and in on the laptop and do all the syncing stuff people describe here. It may not be the best move, because the laptop can get stolen, etc, so for that possibility I regularly make an image of my drive to a hard disk I leave at home.

mmr
That's an excellent point, thanks!
MrBoJangles
Distributed version control eliminates such need for a single point of failure. Every repository is equal to the others.
Nowhere man
+1  A: 

Use version control, and host it on a remote server. This gives you:

  • off-site backups
  • remote access to your code from anywhere
  • version history that is easy to manage (right tool for the job!)
  • transferable skills when you work on another project where multiple people are involved
+1  A: 

I'm not familiar with the specifics of how shadow copy works in Vista, but even assuming you could revert changes, I think it is a good idea to use version control anyway for a couple reasons:

  1. You get in the habit of doing it. This becomes a huge bonus if you end up working on a larger team later on.
  2. You get the advantages of checking in changes with comments. This makes it a lot easier to find a specific change later if you need to revert.
  3. You get the advantages of things like tagging, branching, and merging. I've worked on several small projects in the past where I was the only developer, and I would still find myself in a situation where I would need to fix a problem in a "released" version of my app, but was in the middle of new functionality which wasn't yet ready for prime time. A branch is a good solution to this problem.

These are probably not the most compelling reasons, but they are pretty important to me. If you are in a situation where you don't have Vista shadow copy, I would recommend you stop whatever your doing and start using a VC system right now.

Hope this is helpful.

ckramer
+2  A: 

For windows, I recommend Mercurial and TortoiseHG.

No need to set up a server, you can just right-click your project folder, Create Repo Here, and away you go!

Blorgbeard
Oh, nice! I'll have to check them out.
MrBoJangles
+1  A: 

Using version control is very helpful if you happen to work on several machines at once. You can always continue working everywhere, knowing that you are up to date.

You also know that if you mess up or your harddrive dies, your repository (ideally on a remote machine) works as a great backup.

It is easy to checkout at another location on the disk just to try this new nifty idea out. If it didn't work, just throw it away, if it did, just commit.

Using version control software it is easy to backup the whole repository (including history!) or move it to another machine, which is not possible for filesystem shadow copies.

Version control enables you to give annotations (comments) to single commits, which shadow copy also does not provide. It is also important to note that you are in control when exactly a commit is happening.

Finally, if your project grows larger, good version control software like Subversion enables you to easily create branches/tags. These enable you for example to tag a specific release of your software. If someone finds a bug in the release you can easily check it out to provide a fix, without messing with your current work in progress.

And btw, if you happen to use version control and you decide carefully about which files to have in the repository and which not, you will always be able to have a clean working folder, not messed up with test code files, old data used for testing/production etc.

ypnos
+2  A: 

Source Control should absolutely be used. It is not only a tool for collaboration between multiple developers.

One of the biggest advantages I would say for a single developer will be the ability to do differentials between versions of your files. You can do a comparison of version 4 and version 6 of SampleClass.cs to see what changes you made if you are trying to find what may have caused the introduction of a bug or many other things.

Along with the open source solutions, as a single developer, I would suggest taking a look at SourceGear's Vault product at http://www.sourcegear.com/vault/index.html. It is free for use as a single user, with all features enabled. You only have to begin licensing if you need to introduct multiple users.

I would recommend taking a read through http://www.ericsink.com/scm/source_control.html. It is a very good article in general about source control although it is mainly focused on SourceGear's product.

I work primarily on projects by myself, although I do have collaborative projects too, and in either case, I would never approach them without source control in place.

ManiacZX
+1  A: 

Well, the answer is generally "yes", but it really depends on you and how you work. If you find yourself in a position where you need to restore your code to a previous state, revision control is definitely what you want. If you don't find yourself in such a situation, you probably don't need it.

Use what works for you. A system is only good if its used and used correctly. So if you decide on going the version control route, shop around, watch some videos (there's tons on youtube) on the various ones available and choose what works best for you, because your tools should end up helping you and not getting in your way.

I use git because I find it simply makes sense and it comes naturally to me.

carleeto
A: 

Duplicate of http://stackoverflow.com/questions/52608/is-subversion-version-control-necessary-for-a-small-development-group-1-2-progr#52624

17 of 26
I disagree-- this is just for a single developer, that question was for 1-2 developers (ie, expecting the project to scale, or to have a partner).
mmr
Most of the discussion is about how you should have source control no matter what, even if it's one person. I think it makes sense to funnel all of this discussion into the same thread rather than have two different ones.
17 of 26
Ohh, the arbitrariness of it all, d'oh!
MrBoJangles