Skip to main content

Command Palette

Search for a command to run...

Why Version Control Exists: The Pendrive Problem

How developers used to share code with pen-drives—and why version control became essential

Updated
3 min readView as Markdown
Why Version Control Exists: The Pendrive Problem
M

I am a Software developer. Who want's to become the best in his field, want to grow to my fullest and push past my limit. Always thriving for knowledge. Love to code, like to connect to like minded people who are in coding. Love to play cricket, but don't watch that much.

What is this pen-drive problem ?

Pen-drive problem is the most common problem that used to exist before Version Control was available.

To clearly understand this problem, let us imagine a scenario.

You are a developer working on a project (Social Media Application), and you want to implement real-time chat into your project, but you have no idea how to do so. That’s why you asked your friend for help. Now, for your friend to help you, he needs the codebase. So you decided to copy your codebase onto a pen-drive and give it to your friend.

Now, you might think that it's not that big of a deal; you just have to copy the code and share it with your friend.
But imagine your friend lives in another state, country, or somewhere you cannot go to give the pen-drive to him. And that is only the first problem. The second problem is you won't be able to see what he changed in the code. This means there is no way of tracking the changes in the codebase if more than two people are working on the code. Also, due to this lack of tracking, you might think that when one person works on the codebase, the other person will not touch the code at all. That brings us to the second problem, which is Collaboration. This means you won't be able to collaborate with your friends on the same code.

Version Control System (VCS)

A version control system is a tool that helps you track, manage, and control changes to your files and code over time. Imagine you are working on the code and have a VCS set up in your code. This will help you track the files and folders in that particular directory. It keeps looking for any changes happening in the codebase and finds differences between the old and new versions by using different algorithms. It also creates snapshots of the entire codebase from time to time.

Now, if you have a version control system on the local system, it will help you track the files and manage logs of the codebase.

But what about collaboration?

Now you think that tracking is achieved, so to achieve collaboration, what if we put this VCS on a server where all the developers on the team can push their code, and it will keep track of who changed what.

Now, since the version control system is on the server and tracking every file, and you also have your local version control system installed on your system, both of you will know who changed what, and you can freely work together at the same time, knowing what the other person changed.

Version control also provides you with a rollback facility, which doesn’t exist on a pen drive. What does rollback mean?

Rollback means that if you changed something in the code and you think the changes made are wrong, or you want to go back to the previously saved version of the code, you can do so by using some commands provided by your version control.

Now, there are multiple version control systems available on the internet, and depending on which version control you are using, the commands may differ. A few version control systems are:

  1. Git (Most widely used)

  2. Subversion

  3. Mercurial

  4. Perforce

  5. CVS