HACKER Q&A
📣 SamuelAdams

Why should my company use source control?


Hi guys,

I'm a programmer at a big company. Prior to working here, I have worked at several other organizations who all used Git as a version control system. As a result, I am very well versed in how to use git.

However, my department does not use version control at all. They simply do not see a need for it. So far, most of my reasons for using source control have been discarded due to another tool already doing that thing. For example:

* Git is a backup of your source code. If your code is on the server, and you lose your laptop, you're still relatively OK.

* Rebuttal: We store code on a network share, which is backed up automatically every night.

* Git allows people to easily collaborate on the same project (branches, pull requests, merges).

* Rebuttal: We rarely have multiple people working on the same system at the same time - the benefits will be negligible, and only add complexity to our daily work (this is true, work here is very silo'd).

* Git allows you to store a version history so you can see what changed and why.

* Rebuttal: We don't care for the past: we only care about the current state and what it's not doing correctly (or needs to do / enhancement).

So, HN, my question to you is: what other benefits of Git / source control exist that I can bring to management to hopefully swing our team into using it daily?


  👤 sethammons Accepted Answer ✓
Reading the post title, I think my brain hit a segfault.

I sometimes want to undo an hour of work. Git to the rescue.

I sometimes want to compare code now to code then. Git the the rescue.

Sometimes, I have to undo days of work. Git to the rescue.

Sometimes a really good git commit will help me understand why something changed (though, I contend this should be documented in the code with comments). Links to tickets, other files that were changed at the same time, etc. Git to the rescue.

I _want_ code reviews. It is how we learn from each other and get better. Git to the rescue.

I run automated tests against my code to make sure it works the way I want. Multiple layers. Especially at the black box layer (ie, does it do what the customer wants). Sometimes my new code breaks tests and I want to easily switch between the known stable version and my broken version as I fix my version. Git to the rescue.

Sometimes I want to share my code to help a colleague learn. Online source code viewer to the rescue! (cough, Github, cough). To leverage Github? Git to the rescue.


👤 carapace
Just get another job. Life is short and ain't nobody got time for this in 2020.

👤 Scarblac
Daily backups help nothing if you accidentally delete a file you wrote today. It's far too slow.

Being able to review code by a coworker before it is merged into master is also a big one, as well as having different versions around for currently in use, currently being tested, currently being developed and so on.

But they sound like they have already made up their mind, and you will build negative work experience in your time there...

Anyway you can still use Git locally I guess.


👤 probinso
First let me say HAAAHAHAHAHAHAHA

Now that I have that out of the way...

don't sell them on version control, they obviously don't care. Sell them on oversite in project management tools that are coupled with the code versioning system. Then bate n' switch them.


👤 davidw
Yikes. The snarky answer: find a better place to work.

I mean... people have been using version control for decades. It's not controversial.


👤 tboyd47
Imagine if instead of having to go ask the author why they made a certain change to the code, or look it up in documentation, every developer on the team already knows the reason behind every change made to the system, and this is true going forward even if the entire team is replaced.

👤 ericlewis
I would push on the version history, having a history lets you understand decisions and codepaths that lead to it not working correctly. This is invaluable, and if anything breaks majorly: you can roll back.

👤 robcohen
Yikes. I have had the misfortune of working in places where explaining the benefits of basic technologies lands on deaf ears. This happens a lot with regard to infosec (requiring 2FA, enforcing password manager use).

Quite honestly just do your best to move the company forward. There's really very little reason to not use best practice approaches, especially when doing so costs nothing other trekking the learning curve.

If you get too much resistance, find a better place to work.

If you are a dev, you don't want to be working anywhere that is failing to follow the most basic best practices.


👤 frou_dh
> Git allows people to easily collaborate on the same project

> Rebuttal: We rarely have multiple people working on the same system at the same time - the benefits will be negligible, and only add complexity to our daily work (this is true, work here is very silo'd).

Working for long stretches in this kind of culture is likely to stunt your personal growth. You can learn more in 6 months of direct collaboration with someone who really cares about development, than in 5 years at a silo'd place with little to no collaboration.


👤 Jtsummers
Their last rebuttal is the problem. You could easily counter the others.

First rebuttal:

> We store code on a network share, which is backed up automatically every night.

Git (and other version control systems) permit more frequent backups independent of policies established by the sysadmins.

Second rebuttal:

> We rarely have multiple people working on the same system at the same time - the benefits will be negligible, and only add complexity to our daily work (this is true, work here is very silo'd).

If most things are only touched by one person, then git (and most other version control systems) add negligible complexity. While not advisable, you could even have them work off of master (as they do now anyways). [This lets git be a gateway to process improvement. Once they see the fine-grained snapshots and realize they could have people work on the same code at the same time, they may start using branches and other capabilities.]

That last one, though, indicates they don't actually care about anything. The past is not gone. Having these snapshots lets you do a lot of useful things like git bisect. Or the ability to easily rollback to a known good state. If they really don't care about that, I'd run, not walk, to the nearest exit.


👤 downerending
Note that even if the company doesn't use version control, you probably can do so yourself (e.g., with a personal git repo) and get a lot of personal benefits. I've done this at a few shitty jobs.

Believe it or not, it's better for you that there is no version control than that they force a bad one. (Looking at you, Perforce.)


👤 0x1221
What do your colleagues think? Or is every engineer in this big company also incompetent in addition to your management?

👤 giancarlostoro
If there was flooding and all the hard drives failed would you lose all the code? I've heard multiple times about game studios suffering a flooding and losing lots of code.

Version control has lots of uses, it helps you branch out and test new ideas, it saves your code from local doomsday scenarios at the office. Helps you to ask the correct developer what the code is supposed to do due to version commit history.

You can always keep your own local git repo. A coworker had a git repo inside an SVN repo, just add each version controls contents to a git / svn ignore file.


👤 Wowfunhappy
...I honestly kind of agree with your department regarding points 1 and 2. If programmers never collaborate, and they have a backup system in place, then you don't need git for those things.

But point 3 is a super big one, so I'd focus on that. Is there really know time when your company took something out that they realized they wanted later? There's never been a regression they had to roll back? Really?

If not, you might tell them that it's helpful to you as a programmer to be able to refer to how something was done previously.


👤 throw51319
This is a ridiculous question. If your current state doesn't work, then of course you want to go back to the last state available that works. Git gives you more control over this.

👤 jwalgenbach
If you have a breaking change in a new version of the code with lots of changes, or don't discover the break until several revisions later, git can help find the responsible code with git bisect.

The idea is to manage and track change to your code base so that you can answer questions about the code base efficiently when there are problems.


👤 codegeek
Tell them that you overwrote several hundred lines of code by mistake and now there is no way to get to the previous version. Do they have a backup for that previous instance ? If not, they have the answer.

👤 borplk
If you are otherwise happy with the job I'd say just let it go. You don't need to fight anyone or convince them.

👤 kazinator
> we only care about the current state and what it's not doing correctly

That's just too ignorant for words.

You're trying to teach bush people to boil water to kill germs.


👤 taway555
what about code review? And if the answer is that everyone at the company is a rock star and doesn't ever need code review, then I'll be at a loss of words.

👤 Foober223
You can use git locally to get some of the benefits for yourself. No one even has to know. Distributed git FTW.


👤 saluki
y, it's tough changing 'the way we've always done it'

I would just use git/github locally for what you work on, then you can enjoy the benefits.

Perhaps at some point they will need to see what something looked like 6 months ago and you can WOW them with the magic of GIT.

Good luck, it's tough trying to change culture.


👤 factorialboy
Which industry is this? Make a security / compliance case that mid-management cannot overlook.

👤 Sevii
How do you safely rollback changes?

👤 techslave
branches. code review. obvi you can do both without SCM but boy does it help

👤 stakkur
Here's an (extremely) short but useful explanation of 'why': https://docs.microsoft.com/en-us/azure/devops/learn/git/what...

TL;DR: source control is about so much more than 'backing up'.