4

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?

4
  • 3
    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! Jun 17, 2011 at 23:51
  • 4
    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. Jun 18, 2011 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...) Jul 18, 2011 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). Jul 18, 2011 at 23:01

4 Answers 4

21

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.

17
  • 1
    There's always a solution to the "runs on legacy systems" argument. If there's a network connection, then it should be trivial to host a source control server on another machine and deploy to the host machine, even if the host itself can't run a source control client for whatever reason (have you tried compiling a source control client for the target platform by any chance?) Jun 17, 2011 at 22:19
  • 1
    @jk: The OP eluded to the source running/existing on multiple machines, in which case the source control should be centralized. Jun 17, 2011 at 22:21
  • 4
    @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. Jun 17, 2011 at 22:49
  • 2
    @tgwizard: Cleanliness as nothing to do with this. Even if the whole thing is one giant, twisted mass of snakes it needs to be tracked. In fact it may be even more important for nasty code to be tracked because any single change could cause the whole thing to explode in your face. Jun 17, 2011 at 23:15
  • 2
    @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. Jun 17, 2011 at 23:18
3

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.

1

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.

1
  • 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, 2011 at 23:07
1

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.

1
  • 1
    This is be a bad advice. I can imagine the outrage from management (imho totally understandable), when you put company property out on a server on the internet...
    – mhr
    Aug 7, 2014 at 5:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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