In this quick guide, we introduce you to one VCS, Git ( ), and one online hosting site, GitHub ( ), both of which are currently popular among scientists and programmers in general. The collaborative aspect is enhanced with the emergence of websites that host version-controlled code. Using a VCS, your collaborators can make and save changes to the code, and you can automatically incorporate these changes to the main code base. Furthermore, you can record messages as you save each successive version so that you (or anyone else) reviewing the development history of the code is able to understand the rationale for the given edits. Thus, you can experiment with new ideas but always have the option to revert to a specific past version of the code you used to generate particular results. A version control system (VCS) allows you to track the iterative changes you make to your code. If you email the code to multiple people, you will have to manually incorporate all the changes each of them sends.įortunately, software engineers have already developed software to manage these issues: version control. Second, you will likely share your code with multiple lab mates or collaborators, and they may have suggestions on how to improve it. It is difficult to remember the differences between the versions of the files and, more importantly, which version you used to produce specific results, especially if you return to the code months later. However, this can quickly become a problem because it clutters your file system with uninformative filenames, e.g., analysis.sh, analysis_02.sh, analysis_03.sh, etc. One often-utilized solution is to make a copy of the script before making new edits. First, you often need to experiment with new ideas, such as adding new features to a script or increasing the speed of a slow step, but you do not want to risk breaking the currently working code. However, a few key problems can arise when iteratively developing code that make it difficult to document and track which code version was used to create each result. Just as experiments are logged in laboratory notebooks, it is important to document the code you use for analysis. Many scientists write code as part of their research.
0 Comments
Leave a Reply. |