# Why Version Control Exists: The Pen-drive Problem

## **Why version control exists**

* Version control exists to solve the chaos of collaborating on, tracking, and managing changes to files (usually code) over time.
    
* Without it, development is slow, risky and prone to loosing work
    

## **The Pendrive Analogy in software development**

* The Pendrive problem is a popular analogy for the chaotic pre git era, where developers used physical drives to share code. Leading to overwritten work, lost history, and inefficient serial development.
    
* Imagine `Developer A` and `Developer B` are building a project, they do not use git, only container one file called `script.js`
    
* `Developer A` gives the USB to `Developer B`
    
* `Developer A` wants to fix a bug in `script.js` file, but he can not, because developer B has the USB drive. Developer A must sit idle or work on a separate, unsynced local copy
    
* Conflit:
    
    * Now, `Developer B` opens `script.js`, edits line 10 and saves it on the USB
        
    * Simultaneously, `Developer A` (thinking they are smart) copies the old `script.js` to their desktop, edits line 20 and saves it
        
    * `Developer A` plugs in the USB to update it, relies `Developer B` already updated it, and copies their version over, silently deleting `Developer B`’s changes on line 10
        
* So, To manage version they start creating folders like…
    
    * `Project`
        
    * `project_final`
        
    * `Project_final_v2`
        
    * `project_actual_final_final`
        
* `Developer B` is rushing, brings the USB home and accidentally steps on it, then All Project history is lost for ever
    
* In later stages, developers uses emails instead of pen drives, but most of these issues were not solved.
    

## **Problems faced with out Version control systems**

* **One person at a time:** Only one person is allowed to work on one thing, the process becomes slow.
    
* **Files were overridden:** Unknowingly developers might override other persons code
    
* **No version history**: easy to loss the code, and if a bug is present in resent changes, we could not able to revert to previous working state
    
* **USB device is lost?** entire developers work is also lost
    
    Multiple Developers editing same file without version control
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769313164947/52dddbca-10dc-44d3-8614-9952d606b851.jpeg align="center")
    
    Time line showing file versions getting lost or overwritten
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769313185539/20e1c1e6-710d-4f6b-b031-3a65d9433314.jpeg align="center")
    

## **Why version control Exists**

Version control systems like git exist to solve above problems by providing

* **Parallel Development:** Everyone works simultaneously and system merges changes later
    
* **Single source of truth:** A centralised or shared repository ensures everyone knows which version is latest
    
* **Track history:** every change, who made it, and when made, is recorded.
    
* **Undo capability:** if a bug is introduced, you can revert to a previous working session
    
* **Branching:** you can create a branch to experiment, which won’t break the main code and merge it later only if it works.
    

| No VCS | VCS |
| --- | --- |
| One person at a time | Many people any time |
| Files are overwrittern | Changes are merged |
| Non existent or no manual | Full and detailed audit log |
| Fragile (lost USB = lost work) | Secure, every user has a copy |
| Panic, loss of work | Detected early, easily resolved. |

Pendrive Analogy vs Version control System

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769313231416/e234a017-19a6-4d82-90c7-7e50f849dc14.jpeg align="center")
