📜 ⬆️ ⬇️

Git and team development (for dummies)

Introduction


Hello! If you come here, then you are interested in the question of how programmers work in a team. If before that you worked only in solo, then it probably seems to you that it’s easier to work in a team, because more hands and that means you can cope with work much faster. But not everything is so simple. Now we will get to know with what tools we are developing and what is happening inside the team.

Git


Surely you know this situation.



It's about the issue of versioning. Usually such a problem is encountered in creative people who constantly rework everything and achieve an ideal. Unfortunately, in programming, too, not always everything works out the first time. Imagine a situation: you figured out how to alter a piece of code so that it works a little faster. You rewrite, compile, run and understand that now the program does not work at all. It all broke.

And here you realize that you have not saved the working version, and the Z button on your keyboard has broken, so you cannot even spam ctrl + z. In a fit of rage, you punch the monitor with your pumped right hand. In the evening, you're crying, wrapped in plaedik, and think about the plight of programmers.

A deplorable situation ... And to prevent this from happening, you need to save versions of your code.

Well, programmers are smart people, and they perfectly understood that storing all versions in the form of a heap of files is not convenient as much as possible and that you need to immediately come up with something that will facilitate the storage of versions and thereby solve the problem of versioning.

And here we can draw an analogy with games. Almost all AAA projects have a save system. As a graphic example, you can bring the game Papers Please.



Approximately also all version control systems work.

Version Control System (VCS) is a system that records changes to a file or set of files over a long period of time, so that it can later return to a specific version.

SLE classification:

  1. Local
  2. Centralized
  3. Distributed

We have already dealt with local hard currencies (these are the same heaps of identical files)

Centralized SLE





Examples:


Distributed SLE




  1. Clients completely copy the entire repository.
  2. The central server is responsible for providing the primary copy.
  3. Synchronization can be
    • With server
    • With any client


Examples:


Why you need hard currency


  1. Keeping all project changes
  2. The ability to switch "at any stage of the project development"
  3. Ability to conduct simultaneous team development
  4. Ability to solve problems like the following



Git


Git - distributed version control system
Posted by: Linus Torvalds
2005 - the first version

Installation:
Linux: sudo apt install git
Windows / macOS: link

Developers use:


Basic concepts


Repository (repository, repo) - a place where hard currency stores its metadata and database of project objects
Working directory (working directory) - a copy of a specific version of a project extracted from the repository
The staged area is a service file containing information about what should be included in the next revision of the project.
Revision (revision) - an object that stores a change in the state of a project (project version)
Commit (commit) - create a new revision

GIT configuration setup


Username Setup

git config --global user.name "Your Name" git config --global user.email you@abc.net 

Settings are saved to a hidden .gitconfig file (in the user's home directory)

 [user] name = John Doe email = jdoe@example.com 

Creating a repository

 mkdir first_git_repo cd first_git_repo git init 

Project File States


  1. Fixed
    the file is already in the repository
  2. Modified
    the file is different in content from its fixed state
  3. Prepared
    a modified file that will become fixed after creating a new revision (this file will be included in this revision)

Work with code





  1. Change in project code: creating / deleting / editing files
    In any IDE
  2. View status
    git status
  3. Add modified files to the index
    (translation to Staged state)
    git add имена_файлов_через_пробел
  4. Create revision (from Staged to Repo)
    git commit -m "Комментарий"

Summarize




Work with hard currency


What to store?

[+] All source files
[+] All resources required for compilation.
[+] project compilation settings
[-] project settings in IDE
[-] files compiled from source
[-] executable files

Remove from index

git rm имя_файла

A commit can contain changes to several files.

When to commit?


View history

 git log git log --graph 



Revision number = SHA-1 change hash

Switch to revision

 git checkout sha1_hash git checkout первые_8_цифр_sha1 

Branches


A branch (Eng. Branch ) is a sequence of commits, in which a parallel development of a functional is conducted.

The main branch is master



Branches in git


Show all branches existing in the repository

git branch

Create a thread

git branch имя

Switch to a branch

git checkout имя
At this point there should be no unsaved changes.

Create a branch and switch to it.

git checkout -b имя

Merging branches


Merging branches (eng. Merge) - the process of integrating changes (commits) from one branch to another:

b1 - the branch to which we add changes
b2 - the branch from which we add changes



 git checkout b1 git merge b2 

View history


Window utilities:




Deleting branches


Delete branch

git branch –d имя_ветки

REMOVE a thread

git branch –D имя_ветки

Or rather, delete the branch, without waiting for the commit to move to master

Unsaved change buffer


Or "what to do if you need to switch to another branch, and commit to do early?"

Write changes to a temporary buffer.

git stash

Fetch these changes from the buffer

git stash pop

Useful links:

git-scm.com/book/ru/v2
githowto.com/ru
ru.wikipedia.org/wiki/system_management_versions

Team development


So, if you get to this line, it means that you have at least a little understanding of git (I really hope so). But what about team development? Let's look at this question in more detail.

A small humorous task:

Given:


Question:


Answer:


Hmm, what is a team? What is she like?

A team is a small number of people:


A very important note: as a team you must feel absolutely comfortable and try to get along with the whole team, otherwise everything may not go according to plan.

So, now you understand what a team is. But the next question that arises in your head (yes, yes, the authors of this article can read minds): “And who is responsible for what in the team? Does everyone "have their place"? Or does everyone do what they want? ”

Naturally, each participant in the team has its own role and its tasks. Otherwise, instead of developing a product, there would be chaos. Let's look at what roles are in team programming:

  1. Team Leader:

    Team Leader is a cross between a project manager and a qualified developer.

    On projects there are two lead roles: management - PM, and technical - System Architect. Timlid partly fulfills both roles, but the focus of his responsibilities is on management (the focus on the technical part is the tech lead).

    “Team Leadership # 1: Caring for Your Team.” The team must feel comfortable in the working environment and be well motivated. In addition, the team leader also provides professional and career growth for his children, regularly holds talks on the topic where people are interested in developing and helps them in this. ”

    The managerial role of a team lead includes such duties as management, distribution and delegation of tasks, various assessments and work schedules, monitoring the project status, as well as meetings, communication with the customer, management and all team members (developers, testers, managers).

    Under the technical role: participation in the writing of technical documentation, the choice of technologies for the project, the development of architecture, R & D, code review, junior mentoring, technical interviews, competent involvement of new team members in the workflow, responsibility for the technical part of the project.

    A typical work day team includes:

    • consideration of new tasks and their distribution
    • stand-up team
    • rallies
    • programming
    • architectural issues
    • code review
  2. Project manager:

    Project Manager is an expert whose main task is to manage the project as a whole: design and prioritization, task planning, control, communication, and operational problem solving.

    The main responsibility and responsibility of PM is to bring the idea of ​​the customer to implementation within the prescribed period, using existing resources. As part of this task, PM needs to build a development plan, organize the team, set up the project work process, provide feedback between the teams and the customer, eliminate interference for the teams, control the quality and delivery of the product on time.

    PM's objectives can be classified as tactical and strategic. Tactical is the solution to everyday project problems, removing obstacles from the team’s path. Strategic are to coordinate the overall goal of the project, the path to it, as well as the speed of movement.

    "The main task setting for PM is:" We need this to work, "which means that the team will deliver the result in a reasonable time frame with a reasonable level of quality."
  3. Tester:

    A tester is a specialist who tests a software product in order to detect errors in its work and then correct them.

    The main duties of the tester:

    • Quality control of developed products.
    • Identification and analysis of errors and problems encountered by users when working with software products.
    • Development of autotests and their regular run.
    • Development of test scripts.
    • Documenting defects found.

  4. Developers:

    • Junior:
      Junior is an entry level developer.

      Having completed an internship, a person turns into a full-fledged joon. The main requirement for it is the ability to independently perform technical tasks. If an architecture is built in the project, it should immediately implement another piece of typical application logic. Although Junior may be mistaken from time to time, do not understand the nuances, discuss implementation plans with the team leader or check the ready code with him.

      It is necessary to understand that the tasks that the Signor will solve in ten minutes, June may require three sets of an hour each, and in the process you will have to rewrite the code completely, spending a lot of additional energy. It is important not to be afraid of this and feel the balance: when to press on, try to solve the problem yourself, and when, on the contrary, stop beating your head against the wall, burning the project time, and ask for help. To justify your lack of productivity with the phrase “I'm still jun” is a bad idea.
    • Middle:

      Middle is a mid-level developer.

      The main requirement for a middle-developer is the ability to independently perform the tasks assigned to him. Very similar to what was written in the previous paragraph, right? However, there is an important nuance - there is no word "technical". That is, at a new level, you need to understand the requirements of the business and be able to translate them into technical solutions.

      In this way:

      1. The middle developer understands what the application is doing. This allows a deeper understanding of the task, and, therefore, it is more accurate to evaluate and better implement it. If the requirements do not fully cover any scenario, a good developer will pay attention to it at the planning stage. And not when the application starts to fall for any non-standard user action.
      2. Middle developer is familiar with standard templates and solutions when building an application in his field, he understands why they are needed, and knows how to use them. Standardization of solutions is of great importance in the collective development of code, since it allows a new person to quickly understand what is happening and minimizes the number of errors. Understanding the structure of a typical application makes the task of building it from scratch rather trivial, allows you to talk about the principles of proper implementation and to distinguish good code from bad code.
      3. Middle developer understands that not one works. He knows how to interact with other team members: he can discuss a difficult moment with a designer, clarify incomplete requirements with a business analyst, or agree on some important technical solution with the project architect (if there is one) and, of course, owns the appropriate team development tools.
    • Senior:

      Senior is a high-level developer who has seen a lot of code, stuffed a bunch of cones and managed to draw the right conclusions from it. The main task of the signor is to make the right technological decisions in the project. The “correct” ones are those that bring the maximum benefit to the business and minimize costs. A good signor not only understands what the team is developing, but thinks what tasks the finished application should solve. When developing a platform for an auction, the signor always asks a question about the peak load and tries to envisage attempts at competitive entries in the database tables. He thinks in advance about the bottlenecks of the system, about the possibility of its scaling, remembers the vulnerabilities and problems caused by improper use of tools.

      Such a specialist does an amazing thing - solves problems before they appear. From the side it resembles the gift of foresight. But if your project lives from fire to fire, and you constantly have to throw out and rewrite pieces of code, these are symptoms that the project receives not enough signor attention.
  5. Designer:

    Designer - the person who is engaged in design. Logical, isn't it?

    Designer's work begins long before the first pixel appears, and ends much later than the last.

    Most people are accustomed to thinking that a design is actually a collection of pictures, colors and fonts that are given to typesetters and programmers in order to get a product. Sometimes this approach works, but more often it turns out a project, which is then embarrassing to add to the portfolio.

    The fact is that to solve the problem is not enough to draw a picture. In the process, a good designer goes through six steps. Here they are:
    • Understanding the problem:

      Work begins with an understanding of the problem, like a theater with a hanger: until you pass the outerwear, you will not go further. If you do not understand the problem, you get an unviable product.
    • Search for a solution:

      When the problem is clear, it is time to look for a solution. In well-established terms, these are all sorts of sketches and prototypes that help build a preliminary vision of the final product.
    • Registration:

      This is just drawing pictures and selection of fonts. Many designers start from here and immediately finish their work, and the results of the work of such designers can be seen in large quantities at Dribble or Behans.
    • Matching:

      Even if you have a slender and elegant solution in your head and on paper, this does not mean that it will look the same to the client. If you omit this stage and just give the client groundwork, then at best they are redone according to their own understanding. What ultimately remains after the client edits will be a little like your work.

    Well, now, finally, you are familiar with all the posts in team development. Here I listed only those positions that are related to programming. If we consider the development of a software product as a business project, then of course there will be added more roles, for example, accountants, marketers, etc.

Conclusion


Well, if you read up to this point - congratulations, you are unreal cool! No, well, really, your brain hasn't boiled over with so much information? I hope no.

So, I hope our article has helped you understand all the intricacies of team development. And you have no questions left on this topic. And when you come to a super-duper-unreal-cool-and-well-known company and you will be hired (even if they try not to be accepted), you will not lose yourself and show your boss who is the main programmer here. Or maybe you will create your company, who knows ;-)

Thanks for attention!

Article written in collaboration with RicardoMilos

Source: https://habr.com/ru/post/440816/