views:

3412

answers:

30

I read all over the Internet (various sites and blogs) about version control. How great it is and how all developers NEED to use it because it is very useful.

Here is the question: do I really need this? I'm a front-end developer (usually just HTML/CSS/JavaScript) and I NEVER had a problem like "Wow, my files from yesterday!". I've tried to use it, installed Subversion and TortoiseSVN, I understand the concept behind version control but... I can't use it (weird for me).

OK, so... Is that bad? I usually work alone (freelancer) and I had no client that asked me to use Subversion (but it never is too late for this, right?). So, should I start and struggle to learn to use Subversion (or something similar?) Or it's just a waste of time?


Related question: Good excuses NOT to use version control.

+36  A: 

There are lots of benefits, yes you need it.

One piece of advice

What tools/techniques can benefit a solo developer?

Best Version control for lone developer

Ed Guiness
+31  A: 

You don't need version control any more than a trapese artist needs a safety net. It's like backing up your hard drive—most of the time it seems redundant as nothing happens but it will be needed eventually. There's no maybes here. It will happen. And you can never predict when and the past is a poor indicator as to when it will happen. It may happen only once ever in the future but even if you know it'll happen once you won't know how bad it will be.

Mark Cidade
+11  A: 

Yes!

Do it. It won't hurt you..

I usually switch from Laptop to PC and back and it's absolutely great to have your code somewhere in a central repository.

Sometimes it's great to go just revert to the latest revision because you screwed up something that would be too difficult to fix..

Tigraine
+7  A: 

Convincing opinion here: good-excuses-not-to-use-version-control

Galwegian
@Galwegian--I think this question is pretty much a duplicate of "Good excuses not to use version control". Anyway, I added the other question up there in the body of the question as a related question.
Onorio Catenacci
+1  A: 

If you are working on your own, and are performing backups on a regular basis, VC may not be needed (unless you count your backups as version history). As soon as you start working with another developer, you should get version control in place so that you don't start over-writing each other's work.

Elie
Backups are a form of version control.
Sam Hoice
A _rudimentary_ form: Backups don't to automatic merging of changes by multiple developers, for example. Elie did note that backups _could_ suffice _until_ multiple developers start working on the same project simultaneously.
mipadi
Source Control is not Backup. You can see backup as a side effect, but source control is about controlling and managing your source code, and that goes way beyond storing it in a safe place.
Sergio Acosta
True, but backups are a version of source control (but not the other way around).
Elie
+4  A: 

Try a DVCS like Git or Bazaar. They are incredibly easy to set up, easy to use, and offer all the important features of Subversion, CVS, etc.

The key is that you can revert back to a working version when you break something, which is often much faster than undoing the change manually.

chills42
+4  A: 

Branching doesn't seem useful to you? Have you never wanted to just try something out to see if it would work? I do a lot of plain old html/css stuff too, and I find that invaluable. There is literally no danger in branching to test something, seeing if it works, and deciding "meh" and then just rolling back.

I've never needed to get to a backup (knock on wood), but I find just the rolling back functionality invaluable.

swilliams
+1  A: 

Even if you don't need it right now, it is something you will need whenever you work in a team.

Null303
+3  A: 

A few perks as a freelancer:

  • Know definitively what you changed in every single file and when (as long as you check in often)
  • Rollback to any version in your past. Surprising how often this is valuable.
  • Track a set of changes as a 'release'. This way you know what each client is currently using and what's in development.
  • Backup
  • The ability to easily share a project if you suddenly aren't solo
Corbin March
+1  A: 

Yes you need it.

At the very least, for a single developer shop, you need to move code into a ProjectName-Date-Time directory several times a day.

That is, write a script that will automatically back up your working directory at lunch and at quitting time, without overwriting other back ups.

This can grow pretty fast, so eventually you'll want to save only the differences between files, which is what a VC application does.

chris
+1  A: 

Having a history of changes to your html/css/javascript can be a godsend. Being able to compare your front-end to the code a month, or several months ago can really go a long way in figuring out why suddenly the template is all askew.

Plus if you ever want/need to get help on your project(s), you'll have an easy system to distribute, track, and deploy updated content.

Definitely do it, you'll thank yourself once you get used to it.

Checkout (one time) Update (beginning of day) Commit (end of task/change after testing)

That's all there is to it. Don't commit EVERY single modification that you're refreshing in the browser, just the one's you want to go live.

Adam
+2  A: 

Since you usually work alone, I would say that it is a good idea to use version control. One of the main benefits I have found in using version control (Subversion in my case), is that when working alone it gives me more confidence in trying a new approach to the problem. You can always branch to a new method or framework of solving the problem and see if you like it better. If it turns out that this branch doesn't work, you can just abandon it and go back to the old method. This also makes it easier to try out the different solutions side by side.

So, if you have ever seen a different approach to solving a problem and you wanted to try it out, I would definitely use version control as a tool to make this easier.

Vern Takebayashi
+1  A: 

Think if it like a backup. It is a little irritating until the day you need it. Then the amount of work you lose is directly proportional to the frequency of your backups.

Another benifit is being able to look at old ways you did things that may have become obsolete in a certain spot but could be usefull in another. Just cut and paste the old code that you got when doing a compare.

That is unless you like reinventing the wheel you already reinvented...

Dining Philanderer
+2  A: 

I wouldn't hire a contractor without them integrating into our processes. They would have to access code via our SVN, and would be unlikely to get paid without meeting unit testing and code review requirements.

If contracting I'd make sure to have solid experience of both VSS (check-in/out) and CVS (merge & conflict) models.

Working on your own you have a great opportunity to play and learn with the latest - I'd be trying out Git.

As a lone developer you can think of source control as an unlimited undo - one that works across sessions and reboots.

Keith
+1  A: 

When things can go wrong they will. It is very nice to have the ability to reference code you may have deleted a month ago, or to recover the entire project after a hardware failure or upgrade.

There may also be a point in the future when the project is worked on by more than you. The ability to prevent (or control) branching and versioning is a must in an environment like that.

CYBRFRK
+1  A: 

Must must must must must must. You must use version control.

This is of the deepest importance.

If you don't understand why now, you will one day.

Ali A
+15  A: 

It's like asking, do I really need a condom? How safe do you need to be?

kenny
Reminds me of that Bad Idea Jeans commercial from SNL of yore. "Normally I wear protection, but then I thought 'When am I gonna make it back to Haiti?'"
swilliams
+5  A: 

Easy question. The answer is yes.

Joe The Software Developer
A: 

WOW! So many answers! Thank you guys! I really don't know which one to pick! OK, you convinced me guys! Now... What system should I use? Subversion? CVS? Git? Some other? Which one? I preferably want something to run on local server (best scenario on Windows, but Linux - on VMware - can be a great variant) and with VERY small curve of learning.

Thanks again !

Ionut Staicu
Look at the other questions in this area on SO - there's bound to be an answer or ten that matches your situation and requirements.
Jonathan Leffler
Start a new question or search for one already asked.
Max Howell
SVN - if you had trouble use that not git. You can try free or cheap hosting and they will manage it for you. However, SVN on your local machine(s) is pretty trivial
Tim
Not CVS. CVS is old.
Brian
Why does old mean bad? CVS has more tools, documentation and support than any other tool and it does everything important that the others do.
Antz
+85  A: 

Here's a scenario that may illustrate the usefulness of source control even if you work alone.

Your client asks you to implement an ambitious modification to the website. It'll take you a couple of weeks, and involve edits to many pages. You get to work.

You're 50% done with this task when the client calls and tells you to drop what you're doing to make an urgent but more minor change to the site. You're not done with the larger task, so it's not ready to go live, and the client can't wait for the smaller change. But he also wants the minor change to be merged into your work for the larger change.

Maybe you are working on the large task in a separate folder containing a copy of the website. Now you have to figure out how to do the minor change in a way that can be deployed quickly. You work furiously and get it done. The client calls back with further refinement requests. You do this too and deploy it. All is well.

Now you have to merge it into the work in progress for the major change. What did you change for the urgent work? You were working too fast to keep notes. And you can't just diff the two directories easily now that both have changes relative to the baseline you started from.

The above scenario shows that source control can be a great tool, even if you work solo.

  • You can use branches to work on longer-term tasks and then merge the branch back into the main line when it's done.
  • You can compare whole sets of files to other branches or to past revisions to see what's different.
  • You can track work over time (which is great for reporting and invoicing by the way).
  • You can recover any revision of any file based on date or on a milestone that you defined.

Edit: for solo work, Subversion is recommended. CVS is all but antiquated, and GIT is more useful for distributed teams. A good book is "Pragmatic Version Control using Subversion, 2nd Edition" by Mike Mason.

Update: If you prefer git, a good book is "Pragmatic Version Control Using Git" by Travis Swicegood.

Bill Karwin
I don't see the point in installing a subversion server for solo work. It is much more convenient to just create a repository to the directory where the original files are.
iny
Nice reply. BTW @iny: you dont need a subversion SERVER, a local repo is fine. But the advantage of a server is, it's usually remote, so if your house burns down, your code is ok.
Nic Wise
for solo work, it's *git* that's recommended.
hasen j
I think that "solo work" in this context means NOT "working alone" as in working in a disparate team, but being the TEAM. :D
Florin Sabau
@Florin, that's exactly what I meant by solo, git is much better than svn for solo work.
hasen j
exactly. who wants to set up a server for a one person shop? not me. I use mercurial, btw.
Warren P
fossil is awesome for small projects
amwinter
@hasen I think that for beginners learning how to use version control, git, and bazaar are wayyyy more complicated then mercurial. So to say something like "it's git that's recommended", thats a big statement coming from one person. Now if you said "i recommend git" that would be a much better statement.
Metropolis
@Metropolis: my comment was in direct response to the answer claiming "for solo work, Subversion is recommended". my opinion is that svn is pretty useless for a solo developer
hasen j
@hasen I completely agree with that. Distributed systems are much better for solo work. And in my opinion SVN should be dead now that they are out.
Metropolis
A: 

I think you've made the right decision to use some kind of version control. For simplicity, I'd go with SVN (ignore CVS as SVN is basically a "better" CVS)

SVN can work with "local" repositories right on the filesystem and on lots of platform so you don't have to bite off too much in infrastructure (servers, networks, etc)

Great resource for SVN: http://svnbook.red-bean.com

I don't know much about GIT, but it being open source and gain lots of mindshare probably has alot of similar advantages!

Borrowing a quote from somewhere: You might not need it now, but when you do, you'll be glad you did.

Happy versioning!

A: 

Another thing that i don't get it... Should i "checkout" on every single save? Or only once in a while?

Ionut Staicu
Start a new question or search already answered questions on Stack Overflow.
Max Howell
+1  A: 

When your client phones up in a panic because something is broken on the live site and it's a regression, you'll be glad you can just open TortoiseSVN and see what it was you did last Tuesday that caused the breakage.

Max Howell
A: 

Although old and crude, we have found Microsoft Visual SourceSafe to work. It works great for keeping version history. If you are not to worried about branching, which being the solo developer you may not, it might just fit the bill.

As far as checking in, finding a good checkpoint can be a challenge, but checking in on every save will only make versioning hard to track.

Natron
A: 

"Do I really need version control?"

Yes. Unless you write perfect code that never needs to get changed.

An example: I had a requirement. I built up a webpage, spent a day or so on the page, it's Section 508 compatibility (this was about 6-7 years ago), and uploaded to the website. Next the requirement was changed drastically. I spend another day working on the page (and Hayuge Excel files didn't convert into accessible HTML easily). About a week later, client switches asks that we go back to Version A. Source control would have done this in about 10 minutes. As it was, I had to blow another %$#^^&$# day on the task.

Pulsehead
+1  A: 

It's really odd. Ever since I started using version control, I've very occasionally had the need to look up old copies of my code and use them. I never needed to do this before...probably because the idea of doing didn't really stick. It's easy not to notice those times when you could have found version control helpful.

Brian
A: 

Once you start working on a team that references ever upgrading "components" from multiple callers/applications, version control will be an absolute must. In that environment, there is no way that you can keep up with all the permutations of possible change.

6eorge Jetson
A: 

Yes, you need version control either for development purposes or simply for storing your documents. This way, you can go back in time if you're required to do so in order to revert changes or mistake made on a code or documents.

A: 

You need version control just like you need insurance in life.

fastcodejava
+1  A: 

The literal answer to this question is, No, you do not NEED version control.

You do, however, WANT version control, even if you don't know it.


That said, many SCM tools can be mysterious or downright unpleasant to use until you break through the Grok Barrier, so let's revise that a bit:

"You do, however, want EASY-TO-USE version control." And it's out there...download a bunch of recommended visual clients and give them a whirl, then try whichever maps best to the way you think.

Which leads to the question you meant to ask:

Why do I want to use version control?"

Answer: Version control allows you to be FEARLESS!

clozach