Collaborating with Code?

Hi,
I’ve got 2 other people in my team who want to code, and I want to work along with them while coding.

Is there any way that people in a team can collaborate together on code on the cloud? For example, I’ve seen something about Atom Teletype working with VEX PROS but can’t really figure out how…

I use GitHub. You can go to its website and create a repository that you share with the other people you are collaborating with. It is really helpful because it lets you see version history so you can go back to a prior version of say a red autonomous if you’ve made changes that aren’t working. Here’s a simple tutorial: https://product.hubspot.com/blog/git-and-github-tutorial-for-beginners.
There’s an add-on in PROS that lets you upload or ‘push’ your changes to Git and download or ‘pull’ your partners’ changes.

Edit: I found this on the PROS website, which basically says there are a few options:

In order to track changes to your code, as well as to help share your code with other people, you can use a version control system like Git in conjunction with a service like GitHub. If you want to share smaller parts of your code with other people in order to get help (e.g. through the software channel on Discord), you can use something like GitHub Gists or Pastebin.

For more information on how to use Git, including the Git CLI tools and setting up a respository on GitHub, check out the GitHub help pages.

Source: https://pros.cs.purdue.edu/v5/getting-started/new-users.html

13 Likes

Thanks! I’ve taken a look at it and it seems pretty good :slight_smile:.

I use github too, but since I’m the only programmer on my team, I mainly use it for version control.

2 Likes

Git/Github is the best way to collaborate on code, as it manages versions and you control exactly how changes are integrated. Teletype (or vscode liveshare) is more for literally working on the same section of code at once.

13 Likes

Just to reiterate something very important:

Git/GitHub are great tools that, while they support collaboration, are primarily for version control. Knowing how to use git and/or GitHub effectively is something that all programming projects will benefit from, regardless of the number of people who are working on the project at a given moment. My team has been using github for version control and as a cloud-based solution to guaranteed secure storage of our files. In addition, GitHub has become basically the best tool for sharing open-source projects and making code available to a wider community that can benefit from it. In terms of real-time collaboration however, I highly recommend either VS Code’s Liveshare or Atom Teletype. My team uses Teletype even when we are all on-site to ensure that everyone is working at maximum productivity. It greatly helps us work on many different aspects of code at once. The general workflow for using Teletype for collaboration on code in real time should be as follows: one machine (ideally a laptop or something mobile) should be used as the host machine. Files should be locally stored on this machine and this is the machine that should be used to compile and upload code to the V5 brain. Other machines can then enter a sharing mode on any open files on the host machine. My team generally has only the host work on writing actual code, while the “satellite machines” write code in commented blocks so that whenever the host chooses to compile and upload, the code is not ever in an “unfinished” state. When the “satellites” are ready to add or push changes to the robot, they can uncomment blocks of code.

TLDR: GitHub is a great tool for version control, that I highly recommend for ANY programming project. Atom Teletype or VS Code Liveshare is the way to go for real time collaboration.

11 Likes

Github does manage editing the same files with merging of branches and allowing you to select changes when you push. It isn’t real time changes but our team has never had an issue but we normally don’t work on the same subsystem at the same time.

4 Likes

Does it work like a google doc where you can see people edit the code like a google doc ?

No - here’s some introductory information about git: https://www.w3schools.in/git/intro/

There are some extensions for text editors like VSCode/Atom that enable that kind of functionality though.

2 Likes

Can you collaborate with pros using github? I am not able to.

It depends on how you define collaborate. If you mean concurrently editing the same feature, then git isn’t what you want. You probably want something like code share, though I’ve done it over Skype in the past.

Git is more so focused towards individual development and code versioning. You might also try git kraken for a git gui. I hear it’s pretty good.

3 Likes

Ya the issue is concurrently modifying a live document means the code will pretty much never be a working version.

Imagine if you start changing changing a variable name, so now in half the places it’s called left and in the other half its called left_motor. Until you finish making that change everywhere, I can’t test the code at all. Or I am writing new code and that new code is only half written, it’s now illegal code until you finish

Int joystick =

Ends up with just never being valid. On an essay it’s fine, you can rewrite section 1 while I work on section 2. There isn’t a dependence on every moment the essay being perfectly articulate.

So what git does is have you “commit” changes when they actually make sense to he added to the whole program. Say finishing rewriting a function, or renamed a bunch of variables. The other user doesn’t get the updates until you commit that you have fixed all the grammar and use consistent names.

14 Likes

I think what you’re talking about is version control, and luckily enough we have an article on that:

https://wiki.purduesigbots.com/software/version-control

3 Likes

This is actually possible with vscode’s liveshare feature. If you don’t know how to use it just reply and I will help you or use google and search tutorials.

1 Like