Answer the question
In order to leave comments, you need to log in
How to write code in a team?
Hello!
My university friends and I did very well at the university course in Java and now we want to write something together. But since we are newbies, we are lost in how exactly to organize this. How does the process of writing a project in a team of 2-3 people look like for "real" programmers? And how is it organised?
As far as I understand, all the code should be on github , where everyone will download it to their computer, modify it and upload the updated code back to github ? I'm probably missing something, but this approach seems rather problematic to me, because:
If everyone writes code in parallel and changes some class, then it can change its behavior a little. If I don't find out about it while I'm working with this class myself, then I can just write code that doesn't work at all, because the class has already been changed. And then either mine or a friend's work goes nowhere
. How is it organized "in a normal way" ?
I apologize for the same lamer questions, but something Google did not help to figure it out :) Thanks in advance for the answers
Answer the question
In order to leave comments, you need to log in
That's right, they work through git. As a rule, there is a development branch, a master branch, and separate branches for feature development. After the development of each feature, this branch is merged with development via a pull request. When you're ready to release, development is merged into master. Possible conflicts are resolved when merging branches, most often automatically, since git is a pretty smart system, but sometimes you have to do it manually. The whole process is described in more detail in git flow
In general, in a good way, everyone in the team works on their own piece of functionality, which is then glued to the project thanks to the modular architecture. With a good team lead, it will.
And if there is no team lead, or it is bad, then you will regularly resolve conflicts when merging branches + spend time discussing the general vector. A la "San, don't touch the 10th line, I changed it there, ok?"
Read more about git. There are branches. Everyone can branch from the repository and work on their own branch. Then, when you merge your changes into the repository, they show "conflicts" - if there are different versions of the same code, you will have to manually choose what to leave and what to cancel.
Well, how can I tell you, read about SOLID principles before diving into the abyss of team development, otherwise github and other similar tools will not help
https://habr.com/ru/post/208442/
https://habr.com/ru/ company/mailru/blog/412699/
and if you collectively write one class, then something went wrong)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question