Week 3 Learning Journal- CST438
This week, I learned the importance of Version Control Systems (VCS) and gained practical experience using Git. After finishing the lab exercises, I can see why Git is such a critical tool for software engineering, particularly when working in teams.
The Benefits of Using Git The primary advantage of Git is its ability to track the entire history of a project. By maintaining a sequence of snapshots, Git allows developers to pinpoint exactly which versions include specific new features or bug fixes. This history also makes it possible to undo mistakes using commands like revert or reset if a change causes issues.
Another major benefit is the branching system. Branches allow us to maintain multiple independent versions of a project simultaneously. For instance, I can work on a new feature or a bug fix in a separate branch without affecting the main code base until the work is verified and ready to be merged. Finally, Git simplifies the complex task of merging changes from multiple developers, which is essential for any collaborative environment.
Limitations of Git Merge While Git handles the mechanical aspect of combining files, I learned that it does not ensure the code is actually correct. A successful merge, meaning one with no "merge conflicts", does not guarantee that the software is syntactically or logically sound.
A clear example of this is if one developer renames a variable in one branch (e.g., changing x to y), while another developer adds new code referencing the old variable name x in a different branch . Because these changes might happen on different lines, Git will likely merge them without reporting a conflict. However, the resulting program will fail to compile because the variable x is no longer defined. This demonstrates that Git cannot replace team communication or the necessity of compiling and testing code (such as running JUnit tests) after every merge.
Comments
Post a Comment