This article is from medium—-. Welcome to learn php&Laravel with Pilishen; Study group: 109256050
What happens to their code When developers are finished “coding”? How do they keep all this code sorted? I intend to explain it in this article, using only a minimum amount of tech words.
What do developers do with their code once they’ve written it? How do they store all this code? I want to explain these issues in as few technical terms as possible in this article.
Why should I care?
Why do I care?
If you,re asking,I,m guessing that you,re not simply interested in understanding how your team works.
If you ask this question, you’re not just interested in how your team works together.
Okay then, here comes two more reasons why you definitely should care.
good Next, here are two of the reasons why you should care.
First of all, probably the most important reason is because it will give you the opportunity to shine during cocktail parties.And as we know all, that,s what really matters!
First of all, probably the most important reason is that it gives you a chance to show yourself at a party because, as we all know, it’s so important.
And second,because how developers are working is directly putting some constraints on business delivery. Understand it will help you realize that they are not just some immature divas trying to assess some power over the business. No, there is actually hard stuff in there and they are already doing their best.
Second, the way developers work has a direct impact on business delivery. Understanding it will help you understand that they are not some immature role, and that they are not a way to gain business power. It’s actually dry stuff and it’s done pretty well.
The World of The Developer — Definitions
Developer’s World – Definitions
We,ll explain the following terms and names:
- Version control
- GIT
- Branches
- Merge
- Branching model
- GitFlow
- Integration
- Continuous Integration
We will explain the following terms and nouns:
- Version control
- GIT
- branch
- Branch merge
- Branch model
- GITFlow
- integration
- Continuous integration
Version control
Version control
Developer works. The result is code. This code is shared and stored safely is some tool. We call this kind of tool version control because it not only stores safely the code,and allows the developers to share the code and collaborate together as a team on the same code, but also versions the code. That means that every time a developer adds some code, it does not replace the previous version but adds a change in the history instead. That way,developers are allowed to mess up and revert to a previous version easily. They can also investigate issues and understand what happened in the code by looking at the history.
The developer’s job comes down to code. This code can be safely shared and stored using tools. We call these tools version control. Not only are they used to store code securely and enable developers to share their code and collaborate as a team on the same code. Code can also be versioned, which means that whenever developers add some code, they do not replace the previous version, but instead add changes to the history. In this way, developers can easily revert scrambled code back to the previous version. They can also investigate problems and look at the history to see where the code is actually broken.
In some from or another, you,ve used this concept in many collaborative tools outside of the developer world. Google Docs,Slides and Sheets have this concept of history: you can review the past changes and revert to a previous version. The same goes with Wikipedia and other Wiki software, and like the developers, tool you can add some somments to help other user to get a sense out of the historys. As a matter of fact, Wikipedia contributors are urged to take the time to write such a comment to help control bad edits.
You’ve probably used this concept in many collaboration tools outside of the developer world to some extent. Documents, slideshows, and tables like Google’s have this concept of history: you can see history changes and then go back to previous versions. Wiki Wiki software baidu or up also is such, like developers use tools to add comments can help other users to understand the historical changes, as an important practice, wikipedia contributors who urgently need to take the time to write such a annotation tool to help control the bad code submitted.
Git
And GIT,well,is an example of version control software. There are many version control softwares available, but most people agree to say that it is the best version control out there for many great reasons. So today most teams GIT is a version control tool. There are many version control tools available, but most people agree that GIT is the best version control tool for a number of important reasons. So many teams are using GIT today
Branches
Versions like Google Docs and Wikipedia have limitations compared to developer-level version control. When you use these consumer tools, you only have one definitive version at any one time. Use a complete history to control these determined versions. There is only one current version at the end. And whenever you edit documents, you edit them directly on the latest version of the document.
What are doing the developers can be much more complex than what you are doing in Google Docs or Wikipedia. Here are some examples:
- There is several versions of the software simultaneously in production
- Bug-fixes must be delivered on a previous version
- Big features takes a lot of time and cannot be added directly to the last, current version
- Validating new software versions takes time, cannot block the development of new
- software features but cannot be added yet to the version in production
- The And so on…
Version control by developers is much more complex than Google Docs or Wikipedia, as in the following example:
- Multiple versions of software exist simultaneously in a production environment
- Bug fixes must be made on the previous release
- Large features take a lot of time and cannot be added directly to the latest current release.
- The time it takes to validate a new release does not deter developers from working on new development in the meantime.
- Software functionality cannot be added directly to the production version
- , etc.
Basically, what we are talking about is called branches in the version control terminology. One of these branches have a special meaning and represents what is in production, what is the last, current version. In GIT, it is often (though not always) called the master branch.
Basically, what we’re talking about is branching in version control terms. One of these branches has a special meaning. It represents the code in the production environment, and the most recent current release in GIT is usually (but not always) called the Master branch.
When developers are creating a new feature, they do not work on this branch directly; they create a new branch starting from this one and that way they are able to work freely and independently on this branch. When the work is done, it is merged back into the main branch.
When developers create a new branch, they do not work directly on the main branch, but create a new branch based on that branch, where they can work independently. When this is done, merge the new branch into the main branch.
Fixing a bug on a previous version of the software And it goes the same for the other examples I gave… Yes, that’s branches. Having features in validation before going to production… Yes, more branches.
The same is done in the other example I gave, fixing the development on a previous version of the software. Yes, branches too, verifying features before pushing them into production, and yes, more branches.
Creating and merging branches is truly part of the developer’s routine. That’s simply how they do their jobs.
Creating and merging branches is part of a developer’s daily routine. This is how they work.
Merge
Now I have introduced the term merge in the previous section. Well, that’s when things become tricky
I already mentioned the term merge in the last section. Development gets complicated when it comes to this.
Typical non-trivial merge: the changes on the right relies on code that has been changed on the left
A typical non-collision merge: the change on the right is based on the change already on the left.
Merging branches is not always easy; you have two versions, which one should you take? There is no easy answer, and often you’ll have to take changes from both branches. And maybe the changes of one branch impacts code that only exists on the other branch: when the branch added code that relies on old code that has been changed in the other branch. So really this is something that is not always straightforward. By the way, one of the reasons why people are saying that GIT is so great, is precisely because it makes merging easier.
Merging branches is not always easy: suppose you have two versions, which one do you choose? There are no easy answers, and often you need to adopt some code changes in both branches. When you add old code to a branch that is based on another branch and the old code is modified. Perhaps a change in one branch affects code that only exists on the other branch. So it’s something that’s not always straightforward. One of the reasons people say GIT is great, by the way, is precisely because it makes merging easier
Branching Model
So merging can be tricky. But the kind of merge the team faces depends on when branches are created and on how they are managed. So the team usually agrees to follow some kind of branching and merging policy: this policy is called a branching model.
So mergers can be tricky. But the merging teams face depends on when branches are created and how they are managed. As a result, teams often agree to follow some sort of branch and merge policy: this policy is called the branch model.
GitFlow
GitFlow is a branching pattern. What makes it stand out is that it has been widely shared and thoroughly documented by the community. GitFlow is also popular because it is easy to understand for novices to Git. GitFlow matches the way most people use other version control software.
Today, I believe GitFlow’s greatest strength is its widespread use: it is a way to standardize team and corporate version control practices, and to accelerate the participation of new developers in project development. Your team uses GitFlow, and you hire someone who knows GitFlow and can contribute to the project from day one.
GitFlow: http://nvie.com/posts/a-successful-git-branching-model/
To sum up GitFlow:
- The master teaches what’s in production
- Features and fixes are worked on their own branch
- The features and fixes branches are not directly merged into master when the work is done; it is merged into a branch called develop
- Develop is thus some buffer between “dev done” and “in production”; release branches are made from develop and merged into master
- Release branches can thus be tested and validated at length in staging environment
To summarize GitFlow
- Master stands for code in production.
- Features and fixes work on their own branch.
- The feature and fix branches are not merged directly into the main branch when the work is done; It was incorporated into a branch called development
- So the Develop branch is a buffered branch until development is complete and applied to online production. The Release branch is based on the Develop branch and merged into the Master branch
- The Reslese branch can therefore be fully tested and verified in a staging environment
Integration
As I have explained it, merging a branch can be tricky. There can be hard to predict interactions between the different pieces of code. Unsurprisingly, developers solves this problem by testing the resulting software. If nothing is broken, we’re good! This whole process is called integration: we are integrating two versions of software together by merging their code and by checking (testing) that everything is right.
As I explained, merging a branch can be tricky. It is difficult to predict interactions between different code segments. Not surprisingly, the developers solved this problem by testing the final software. If nothing breaks, we’re fine! This whole process is called integration: we integrate two versions of software together by merging their code and checking (testing) that everything is correct.
Continuous Integration
Obviously, testing the software by hand takes a lot of time, is prone to human error (not even to speak of human boring-ness). and on average slows down the whole process.
Obviously, testing software manually takes a lot of time and is prone to human error (not even considering human boredom), which slows down the entire project development process
Enter the idea of continuous integration, where tests are automated and run by another software. Maybe the most known continuous integration software is Jenkins (yet another buzzword you can use in cocktail parties with your dev team!) .
This leads to the concept of continuous integration, where testing is automated and run by another piece of software. Perhaps the most famous continuous integration software is Jenkins (another term you can brag about when your development team gets together!).
The GitFlow branching model is a great fit for continuous integration. The whole idea is to make sure that whenever a feature branch is merged into develop, the continuous integration checks that everything is right on this main branch. This check is done regularly. Depending on the context of the project and on the maturity of the team, this check may be done only once a day, or on the contrary every time any developer makes any single change (tip: the shorter the feedback, the better)
The GitFlow branching model is well suited for continuous integration. The whole idea is to make sure that every time a feature branch is merged into the Develop branch, continuous integration checks that everything works on that main branch. Such tests are carried out periodically. Depending on the environment of the project and the maturity of the team, this check may be done only once a day, or conversely every time the developer makes any changes (hint: the shorter the feedback, the better).
What’s your take on it?
Getting version control, branching model and continuous integration right is not easy but of paramount importance.
Getting version control, branching model, and continuous integration right is not easy, but it is the most important.
Developers must spend a vast amount of time on these subjects. They should agree on how they do it and work the same way as a team. They should challenge their way of doing regularly and seek for better ways. They should setup or create all the tools they need to do their job well.
Developers must spend a lot of time on these topics. They should agree on how to do this and work in the same way as the team. They should challenge their own way of doing things and find a better way. They should build or create all the tools they need to do their job.