Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What is the best way to develop and maintain legacy code not in version control? Adding it to version control is of course the obvious answer, but if you can't, for some reason, what would you do?

A few reasons I can think of why version control wouldn't be possible are:

  • Management is against it (doesn't understand it, thinks it would take to much time, isn't worth it, etc.)
  • You don't have the administritative privileges to install the required software.
  • The code runs/is stored on legacy systems with limited capabilities for version control.

So, if real version control isn't available, what do you do? Set up some regular backup system? Or perhaps create version-named folders?

share|improve this question
1  
Do you have a directory where you can write? If you don't, you can't compile either, so there must be somewhere. Put the VCS into a directory where you can install it. Put the code under the management of your VCS. Make a branch for whatever is 'out there' in the untamed wilderness; make another branch for you to work on; use a third branch to release too (this might be the trunk or master or main branch). Work with the VCS on your copy of the code. Be careful to deal with other people's changes to the code too. But don't change a thing until you've got the original under version control! –  Jonathan Leffler Jun 17 '11 at 23:51
2  
If you can't do it because of either of your first two bullet points, the best way to deal with the problem is to find a new job. If there's a hand grenade on your desk with the pin pulled out, don't ask on StackExchange how to defuse it - just get the hell out. –  Carson63000 Jun 18 '11 at 23:55
    
@Jonathan - I don't think the problem is compiling the legacy code after moving it to version control, it's installing an application like git or svn to use for version control. The dev environment here is for an intranet, so the VCS can't be compiled (unless you know of a complete one written in Javascript...) –  Kevin Vermeer Jul 18 '11 at 21:36
    
@Kevin: You can usually find precompiled packages. If you can't get hold of those, either, then @Carson63000 has the right idea; it is time to run. I decline to work without a VCS - or several - available to me. I rely on them to keep things straight for me, and allow me to revert to a previous version at any time that I need to do so. Heck, even VSS is better than nothing (though that's a close call). –  Jonathan Leffler Jul 18 '11 at 23:01
add comment

4 Answers 4

up vote 17 down vote accepted

There is no reason to not be able to have version control period.

If management is against it even after having the benefits pointed out to them, they're clearly not fit to be managers and their boss should be approached.

If you don't have administrative privileges, either get them or have someone from IT install the software.

The code shouldn't be executed and be stored on the same machine. You should have centralized source control with a proper deployment pipeline.

share|improve this answer
    
I agree. But, there exists legacy code so large (say, 30000+ lines of code) that cannot easily be run or tested on any other machines than those (old ones) it resides on, so development needs to take place there. (Code still in use but which is so convoluted and interdependent that any radical changes would take longer than rewriting it all.) What would you do then? Version control somewhere else, and transfer the code between somehow? –  tgwizard Jun 17 '11 at 22:11
    
Oh, perhaps "management against it" wasn't a reason after all. But I believe "runs on legacy systems" might have some merit. –  tgwizard Jun 17 '11 at 22:15
1  
@jk: The OP eluded to the source running/existing on multiple machines, in which case the source control should be centralized. –  Demian Brecht Jun 17 '11 at 22:21
1  
@tgwizard: 30,000 LOC is nothing. Hell, a Debian Linux release is estimated at 325 million LOC. As Demian said, there is no excuse for not having this stuff under version control. –  Peter Rowell Jun 17 '11 at 22:49
1  
@tgwizard: The result of the setup far outweighs the cost. There's no way that development should be done on the live server for any web-based system (if that's the case). Proper dev environments should be set up with proper version control and deployment pipelines. –  Demian Brecht Jun 17 '11 at 23:18
show 12 more comments

Git is written in fairly portable C and does not require administrative privileges. That's just one of your options. Nothing unusual about version control being on a separate system from the runtime, either. I write embedded software with the version control server, development environment, and runtime environment all on separate machines.

share|improve this answer
add comment

You don't need admin permissions for all version control systems. Git and Mercurial are two that are free, lightweight and don't require a centralized server.

I can't see any objection they would have to you running it locally and checking the files in there. If you really need to have a centralized server you could do an online service like Github, BitBucket, or Kiln; none of which require a local install requiring admin rights on a server.

share|improve this answer
add comment

Check the IT backup plan for whereever the code is stored. That covers you in case of issues, but it can also give you some valuable back-catalog versions of the project if there are old tapes.

If they are not against keeping multiple versions of the codebase separated by folder, might as well start there. Folders with dates or version numbers is better than nothing.

Though if they let you create those, it is not a very far step to start up a version control, even if it is just a userspace one. Git is in C, so you can likely get it running, even if you are under tight restrictions. (After all, their source compiles somewhere, right?)

Just add a network connection and you've got a real VCS, which has become a basic necessity for programming.

share|improve this answer
1  
It's a intranet, so no compilation needed. This makes coding and testing on a separate machine a bit problematic, though. –  tgwizard Jun 17 '11 at 23:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.