Code collaboration¶
When working on a project together with other people, it is important to have a good way to collaborate on the code. There are many tools available for this purpose, all with their own advantages and disadvantages. In this section, we will discuss some tools for code collaboration ranging from simple to use, to more involved.
We will evaluate them based on the following criteria:
- Complexity: How easy is it to set up and use the tool?
- Version control: Does the tool provide version control features?
- Backups: Does the tool provide a way to back up your code?
- Collaboration: How well does the tool support collaboration between team members? Does it handle conflicts well? Does it allow for real-time or only asynchronous collaboration?
| Tool | Complexity | Version control | Backups | Collaboration | Description |
|---|---|---|---|---|---|
| Cloud storage | Low | No | Yes | Limited | A simple way to share files, but not ideal for code collaboration. |
| Remote pair programming | Medium | No | Yes | Real-time | A tool that allows for real-time collaboration on code, but does not provide version control. |
| Git (+ GitLab) | High | Yes | Yes | Powerful, asynchronous | A powerful version control system that allows for branching and merging. |
It should also be mentioned that all of these tools can be used in combination with each other. For example, you can use Git for version control and backups, and then use remote pair programming for real-time collaboration on the code. Or you can work with git locally and then use cloud storage to share the code with others. The best tool for you will depend on your specific needs and preferences.
Quick summary for the impatient¶
If you are willing to spend some effort, learning git and using GitLab is by far the best option for code collaboration. It provides version control, backups, and powerful collaboration features. It can also be combined with the remote pair programming tool for real-time collaboration.
If you want the least amount of effort, using remote pair programming on a local folder for real-time collaboration, with manual backups is a decent option. It does not provide version control, but it allows for real-time collaboration and is easy to set up.
Cloud storage¶
Cloud storage services like Google Drive, Dropbox, or OneDrive can be used to share code files between team members. This is a simple way to collaborate on code, but it has limitations. It does not provide version control, so it can be difficult to keep track of changes and resolve conflicts. Additionally, it may not be ideal for larger projects with many files. It is also hard to collaborate on the same file at the same time, as it can lead to conflicts and data loss.
Working in cloud storage connected folders often leads to issues
When working in folders that are connected to cloud storage services, it is common that files that are being used during compilation or execution are locked by the cloud storage service, which can lead to issues such as compilation errors or crashes. It is generally recommended to avoid working in folders that are connected to cloud storage services, and instead use a local folder for development and then sync the changes to the cloud storage service. However, this also severely limits the collaboration capabilities of cloud storage services, as it requires taking manual backups.
Remote pair programming¶
Remote pair programming tools like Visual Studio Live Share allow for real-time collaboration on code. This can be a great way to work together on code, as it allows for immediate feedback and discussion. However, it does not provide version control, so it can be difficult to keep track of changes and resolve conflicts. Additionally, it does not provide backups, so a manual system for taking backups must be employed.
Git (and GitLab)¶
Git is a powerful version control system that allows for branching and merging. It is the gold-standard and widely used in the software development industry and has a large community of users. Git provides version control features, allowing you to keep track of changes and has excellent strategies to resolve conflicts. It also provides a way to back up your code, as you can push your changes to a remote repository (e.g. GitLab). Git also supports collaboration between team members, allowing for easy asynchronous collaboration. However, it can be complex to set up and use, especially for those who are new to version control systems.
In simple terms, you can think of Git as a tool that allows you to take snapshots of your code at different points in time, and then allows you to go back to those snapshots if needed. It also allows you to work on different branches of your code, which can be useful for trying out new features or fixing bugs without affecting the main codebase. When you are ready to share your changes with others, you can push your changes to a remote repository, where others can pull your changes and collaborate with you.
For more information on getting started with Git and GitLab, see the Git and Gitlab topic.