Contact Us

5 Good Habits to Improve Your Collaborative Data Science Project | by Arfinda Ilmania | Dec, 2021 | Towards Data Science

Cyber Security | July 22, 2022

Single Responsibility and Open-Closed Principle

Single responsibility means, each class should only do one thing. One of the reasons why each class should have single responsibility is because a class can be changed by more than one member of the group for different reasons. If a class has many responsibilities, the more often the class will be modified then. This can cause module incompatibility and the possibility of conflicts when the code is merged will also be higher.

More Files, More Commits

Working in a team is closely related to using a version control system like Git. One thing that complicates the work the most is the existence of conflicts in certain files caused by different versions of changes from different team members. A possible solution is to create separate files for each different class (or function related to each other). This aims to minimize the possibility of conflicts in files that are being edited by more than one programmer at the same time. Imagine if there is a file that contains many functions, and all programmers edit the same file at the same time, of course it will be very complicated and very risky for conflict.

Leave it Clear, Don’t Hide Behind Comments

Sometimes we may find that writing comments in our code is something that is often debated. In some cases, comments can help other programmers or even the person writing the code easily understand what the code is doing. On the other hand, the presence of comments can sometimes be a bit problematic especially for collaborative projects.

Knowledge sharing

In a project group, of course, each member has a different task. In some cases, there is usually only one person or a few people who understand the whole system. Problems will arise if the person is suddenly absent for a certain period of time or even has to leave the project. In technical terms this can be referred to as a Single Point of Failure, where there is one component which if damaged or lost will disrupt or stop the work of the system as a whole.

Unit Testing

Every programmer should have the mindset that every code cannot be considered correct until it is tested. Especially if the code will be merged with other codes. Testing is very important to reduce the risk of conflicts and errors. In addition, testing will also make debugging easier because we can easily find out which part is wrong by seeing which unit tests fail.

This content was originally published here.