Why Do We Need Version Control Systems?

Let’s take an example, there are two developers who built a project together. Suppose developer ‘A’ writes initial code but now ‘A’ requires help from developer B for a specific feature of the code that part which ‘A’ does not know but developer ‘B’ knows. Since they are working on different machines, how ‘A’ sends the code to ‘B’? So, what could be a possible way? Answer could be maintaining a “Pendrive or physical storage device”. Developer ‘A’ copy and stores the code into the pendrive and physically hand it over to ‘B’. After making necessary updates ‘B’ stores the new files into the pendrive and send it back to ‘A’. Now ‘A’ has all the updated work. However, ‘A’ does not need the old work anymore. However if ‘B’ makes a huge no of changes and add a lot of no of files into the code, but ‘A’ does not know what changes ‘B’ makes and what file is responsible for which feature, so in future if any files needs an update then again ‘A’ puts all the files into a pendrive and give it to ‘B’ , ‘B’ makes necessary changes and gives the updated files into the pendrive and return it to ‘A’.

Now here comes some problems First, we cannot track the changes into the code Second, the pendrive and updated code stays with ‘A’. Also, maybe there is a copy of code also present in ‘B’. Now suddenly ‘B’ notices a bug into the code and fix it into the local machine. Is the updated, bug free code comes to ‘A’? The answer is NO. Now ‘B’ asks the ‘A’ for the pendrive to update the code. ‘B’ gets the pendrive and update the code again and gives the updated, bug free code to ‘A’. Still ‘A’ does not know what changes to make. Now ‘A’ updates some code but ‘B’ still not has the code updated by ‘A’. Now if ‘B’ makes any changes then both of them got out of sync and rather it makes a huge problem, they built a product for which some feature ‘B’ has, some ‘A’, they don’t know how to merge two codes together. Now the problem is at a time only one developer can work on it, means no collaboration exists. We will face the same problem with cloud storages. To prevent this, they might decide that only one developer can work at a time with the code, a very inefficient solution.
While this is the problem with just two developers, if another one developer joins, then it became more hectic to manage code. So, we need a tool or software which manages the code, track changes in the code, also we need a centralized server for it, everyone writes code and push the code into the server so that everyone can access the code also everyone can see which change made by whom. Here the tool or software which track changes is called the Version Control System.
Real World Team Collaboration Problem:
In real world team collaboration, there are more developers than two or three, also multiple persons live in multiple cities or even some lives in different countries, it is hard to manage a single pendrive between cities even countries. Even if we cloud platform to store data it is hard to track changes and if any developer gets out of sync it will hard to manage the code and difficult to merge the code.

Why Version Control System is mandatory for Modern day Development ?:
So, we realize that we need system that can track changes also we need a centralized server to access the code to everyone. In modern day development when there are multiple developers working at different locations it is a necessary to have a system or tool to manage code, track changes and a centralized server to access the code to everyone anytime they want. In Modern day the system that track changes in code is called a Version Control System or VCS, the most popular and widely used VCS is “Git” and the most popular centralized server in today’s world that stores the code and access to everyone is called “GitHub”.
All images in this article were generated using Gemini, an AI by Google.
