When you start working on a project that is going to have multiple versions such as version 1.0, version 1.1, etc... you'll probably need to know how versions work. In this quick read, we'll help you out with that ;)
What is versioning?
Let's start off simple and clarify the meaning of versioning. Versioning is the process of assigning a unique number to each update of your application or library.
You have probably seen this in many libraries or software applications you commonly use on your Mac or PC, like "Version 2 of [app name] is available" or "Version 5 has just been released".
If you are working with application libraries you are probably more common with hearing about more minor releases like 2.1 is available or 5.5 is released.
Versioning makes it easier for users to stay up-to-date on the latest version of any software. It also helps the development team troubleshoot any issues a particular user is experiencing.
Next, let's talk about how to use it.
How does versioning work?
The first number in a version is a Major release, the second is a Minor release, and the third is a Patch release.
Major . Minor . Patch
The Major release is when the library or software includes incompatible updates. This major release may include a restructure, dramatic code change, or even a complete overhaul of the code. The major release will typically include a substantial upgrade process.
The Minor release is when the library or software adds new functionality, good-size updates, or minor re-organization of code. The minor release typically has a small upgrade process. The minor release may include some breaking changes but they are typically not too difficult to resolve.
The Patch release is when the library or software includes a bug fix, patch, or small updates. A patch release should not include any developer changes to upgrade, if it does require the developer to change something or re-write code, then it should be added as a minor release.
Bonus: Which version is greater?
So, a couple years back I remember I was adding a script to a server and the script said that it required PHP 5.6.2 and my server had PHP 5.6.12 so I was like... Ok, I need to upgrade my version of PHP. But after contacting my hosting provider they let me know that my version was greater than the required. Why?
Because in versioning numbers after a period should be treated as a number and not a decimal. A version of 1.22 is greater than 1.3; wheras, with arithmetic and decimals 1.3 > 1.22
Make sure to keep that in mind so you don't get confused with which version numbers are greater or less.
This type of library or software versioning is referred to as Semantic Versioning, if you are ever inclined to dig deeper into all the details of Semantic Versioning you can do so at there website here: https://semver.org/
BTW, This is version 1.0 of this article :D
Comments (0)