<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: varbSan</title>
    <description>The latest articles on DEV Community by varbSan (@varbsan).</description>
    <link>https://dev.to/varbsan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F669246%2F1351f320-0c22-4a76-9a05-e4e369c5a3c4.png</url>
      <title>DEV Community: varbSan</title>
      <link>https://dev.to/varbsan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/varbsan"/>
    <language>en</language>
    <item>
      <title>A Simplified Convention for Naming Branches and Commits in Git</title>
      <dc:creator>varbSan</dc:creator>
      <pubDate>Thu, 19 May 2022 19:00:29 +0000</pubDate>
      <link>https://dev.to/varbsan/a-simplified-convention-for-naming-branches-and-commits-in-git-il4</link>
      <guid>https://dev.to/varbsan/a-simplified-convention-for-naming-branches-and-commits-in-git-il4</guid>
      <description>&lt;p&gt;There are many excellent naming conventions regarding git branches and commits.&lt;br&gt;&lt;br&gt;
But what if you want something very lean and simple?&lt;br&gt;&lt;br&gt;
Here is a proposition.&lt;/p&gt;
&lt;h2&gt;
  
  
  Branch Naming Convention
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://dev.to/couchcamote/git-branching-name-convention-cch"&gt;Git Branching Naming Convention&lt;/a&gt; article is an excellent base.&lt;br&gt;
However, you can simplify even more.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Category&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A git branch should start with a category. Pick one of these: &lt;code&gt;feature&lt;/code&gt;, &lt;code&gt;bugfix&lt;/code&gt;, &lt;code&gt;hotfix&lt;/code&gt;, or &lt;code&gt;test&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;feature&lt;/code&gt; is for adding, refactoring or removing a feature&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bugfix&lt;/code&gt; is for fixing a bug&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;hotfix&lt;/code&gt; is for changing code with a temporary solution and/or without following the usual process (usually because of an emergency)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;test&lt;/code&gt; is for experimenting outside of an issue/ticket&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
After the category, there should be a "&lt;code&gt;/&lt;/code&gt;" followed by the reference of the issue/ticket you are working on. If there's no reference, just add &lt;code&gt;no-ref&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
After the reference, there should be another "&lt;code&gt;/&lt;/code&gt;" followed by a description which sums up the purpose of this specific branch. This description should be short and "kebab-cased".&lt;br&gt;&lt;br&gt;
By default, you can use the title of the issue/ticket you are working on. Just replace any special character by "&lt;code&gt;-&lt;/code&gt;".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To sum up, follow this pattern when branching:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch &amp;lt;category/reference/description-in-kebab-case&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need to add, refactor or remove a feature:
&lt;code&gt;git branch feature/issue-42/create-new-button-component&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;You need to fix a bug:
&lt;code&gt;git branch bugfix/issue-342/button-overlap-form-on-mobile&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;You need to fix a bug really fast (possibly with a temporary solution):
&lt;code&gt;git branch hotfix/no-ref/registration-form-not-working&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;You need to experiment outside of an issue/ticket:
&lt;code&gt;git branch test/no-ref/refactor-components-with-atomic-design&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Commit Naming Convention
&lt;/h2&gt;

&lt;p&gt;For commits, you can combine and simplify the Angular &lt;a href="https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines"&gt;Commit Message Guideline&lt;/a&gt; and the &lt;a href="https://www.conventionalcommits.org/en/v1.0.0/#summary"&gt;Conventional Commits&lt;/a&gt; guideline.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Category&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A commit message should start with a category of change. You can pretty much use the following 4 categories for everything: &lt;code&gt;feat&lt;/code&gt;, &lt;code&gt;fix&lt;/code&gt;, &lt;code&gt;refactor&lt;/code&gt;, and &lt;code&gt;chore&lt;/code&gt;. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;feat&lt;/code&gt; is for adding a new feature&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;fix&lt;/code&gt; is for fixing a bug&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;refactor&lt;/code&gt; is for changing code for peformance or convenience purpose (e.g. readibility)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;chore&lt;/code&gt; is for everything else (writing documentation, formatting, adding tests, cleaning useless code etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After the category, there should be a "&lt;code&gt;:&lt;/code&gt;" announcing the commit description.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Statement(s)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
After the colon, the commit description should consist in short statements describing the changes.&lt;br&gt;&lt;br&gt;
Each statement should start with a verb conjugated in an imperative way. Statements should be seperated from themselves with a "&lt;code&gt;;&lt;/code&gt;".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To sum up, follow this pattern when committing:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -m '&amp;lt;category: do something; do some other things&amp;gt;'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;git commit -m 'feat: add new button component; add new button components to templates'&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git commit -m 'fix: add the stop directive to button component to prevent propagation'&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git commit -m 'refactor: rewrite button component in TypeScript'&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git commit -m 'chore: write button documentation'&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;sources&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;article: &lt;a href="https://dev.to/couchcamote/git-branching-name-convention-cch"&gt;Git Branching Name Convention&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;article: &lt;a href="https://www.conventionalcommits.org/en/v1.0.0/#summary"&gt;Conventional Commits 1.0.0&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;article: &lt;a href="https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines"&gt;Commit Message Guideline&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;article: &lt;a href="https://nvie.com/posts/a-successful-git-branching-model/"&gt;A Successful Git Branching Model&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>programming</category>
      <category>github</category>
    </item>
    <item>
      <title>What is HTTP? (... for newbies)</title>
      <dc:creator>varbSan</dc:creator>
      <pubDate>Mon, 31 Jan 2022 08:22:25 +0000</pubDate>
      <link>https://dev.to/varbsan/what-is-http-for-newbies-em</link>
      <guid>https://dev.to/varbsan/what-is-http-for-newbies-em</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;HTTP stands for Hypertext Transfer Protocol. It is the protocol allowing "clients" and "servers" to exchange information on the web at the Application Layer[^1]. &lt;br&gt;
For example, your computer is the client asking for the data of this very web page to a server, another computer over the internet. For the server to understand the client and vice versa they need to follow the same "standards": the HTTP protocol.&lt;/p&gt;

&lt;p&gt;Interactions between server and client can take 2 forms: an &lt;strong&gt;HTTP request&lt;/strong&gt; or an &lt;strong&gt;HTTP response&lt;/strong&gt;. These requests and responses are carried and can be altered by &lt;strong&gt;proxies&lt;/strong&gt;. The protocol is improving over time, &lt;strong&gt;new versions&lt;/strong&gt; have been released since its birth in 1991.&lt;/p&gt;

&lt;p&gt;Let's dive deeper into this!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is an HTTP request?
&lt;/h2&gt;

&lt;p&gt;An HTTP request is how the client can "talk" to the server.&lt;br&gt;
This request contains a request line, a header, and optionally a body. You specify the method in the request line so the server knows what type of action is excepted. There are 8 methods but the main 5 are:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"GET" to retrieve data from the server&lt;/li&gt;
&lt;li&gt;"POST" to submit data from the server&lt;/li&gt;
&lt;li&gt;"DELETE" to erase data from the server&lt;/li&gt;
&lt;li&gt;"PUT" to completely update data from the server.&lt;/li&gt;
&lt;li&gt;"PATCH" to partially update data from the server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The request header contains meta-information about the request and the client itself, like the browser and the OS used.&lt;/p&gt;

&lt;p&gt;E.g. after you complete a sign-up form with your username and password, you click on submit. Clicking on the submit button triggers an HTTP request. The first line of the request informs the server it's a post request, the body of the request contains the username and the password so the server can process this information. &lt;/p&gt;

&lt;p&gt;In addition to the method, the request line contains the url targeted and the HTTP protocol version the client wants to use using.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is an HTTP response ?
&lt;/h2&gt;

&lt;p&gt;An HTTP response is how the server can talk back to the client after an HTTP request.&lt;br&gt;
This HTTP response contains a status code, a header and an optional body.&lt;/p&gt;

&lt;p&gt;The status code gives information about how the request was processed by the server&lt;/p&gt;

&lt;p&gt;A status code in between 100 and 199 provides information&lt;br&gt;
A status code in between 200 and 299 states the request was successful&lt;br&gt;
A status code in between 300 and 399  informs there is a redirection&lt;br&gt;
A status code in between 400 and 499  informs of an error coming from the client&lt;br&gt;
A status code in between 500 and 599  informs of an error coming from the server&lt;/p&gt;

&lt;p&gt;The response header contains meta-information about the response and the server itself. &lt;br&gt;
The body contains the most important information: usually the HTML content for the webpage the client asked for.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are proxies?
&lt;/h2&gt;

&lt;p&gt;Proxies are computers in-between the client and the server. They carry the HTTP request and response. They can be routers, or modems or more. They can act as caches, gateways etc.&lt;br&gt;
The point is the HTTP message get handled by many computers between the client and the server. We already know many computers handle the data travelling at the Transport Layer[^2], but proxies refer to computers handling the data at the Application Layer. They handle the HTTP message itself. &lt;br&gt;
E.g. when an image get cached for you. A proxy does the caching in between you and the server.&lt;/p&gt;

&lt;h2&gt;
  
  
  How new versions improved HTTP?
&lt;/h2&gt;

&lt;p&gt;In 1991, HTTP 0.9 was the first HTTP protocol. It just had the GET method, and no header. Only HTML was supported in the response body. &lt;/p&gt;

&lt;p&gt;In 1996, HTTP 1.0 was released. The POST method was added to the options for the request line. Meaning, you could now, not only retrieve, but also submit data to a server. The request and response were given a header. Status codes were introduced. And finally, the response body could include images and videos besides HTML text. This made "HTTP" a &lt;em&gt;misnomer&lt;/em&gt;. HMTP (for Hyper Media Transfer Protocol) would have been more accurate but we kept the HTTP acronym for some reason. &lt;br&gt;
Even though HTTP 1.0 added many features some issues remained. The main one was related to the Transport Layer. Long story short, the connection between server and client was closed after each request. In consequence, Three-way Handshake[^3] had to be repeated for each request, causing performance issues. &lt;br&gt;
E.g., loading a page with multiple images was unecessary slow because the client and the server needed to have a back and forth in 3 steps to establish the connection.&lt;/p&gt;

&lt;p&gt;In 1999, HTTP 1.1 was released. The DELETE method was added. And performance was improved by the addition of persistent connections between server and client by default. Pipelining was also added, enabling the client to send many request to a server without waiting to receive the first responses.&lt;/p&gt;

&lt;p&gt;In 2015, HTTP 2.0 made the protocol improve again in performance, security and more.&lt;/p&gt;

&lt;h2&gt;
  
  
  In Short
&lt;/h2&gt;

&lt;p&gt;HTTP is the protocol running the Web. It allows clients and servers to "talk" to each other through requests and responses. &lt;/p&gt;

&lt;p&gt;These interactions are handled by intermediates called proxies. &lt;/p&gt;

&lt;p&gt;Although the base stays the same, HTTP has had several versions of itself since being born in 1991. Each version improved the previous one by adding features, increasing performance, and reinforcing security.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Footnotes&lt;/strong&gt;&lt;br&gt;
[1]: See &lt;a href="https://en.wikipedia.org/wiki/Application_layer"&gt;Application Layer&lt;/a&gt;&lt;br&gt;
[2]: See Transmission Control Protocol (TCP)&lt;br&gt;
[3]: See &lt;a href="https://www.geeksforgeeks.org/tcp-3-way-handshake-process/"&gt;Three-way Handshake&lt;/a&gt;, which is a back and forth between client and server in 3 steps to establish &lt;a href="https://en.wikipedia.org/wiki/Transmission_Control_Protocol"&gt;TCP&lt;/a&gt; connection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sources&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;#article: &lt;a href="https://www.cloudflare.com/en-gb/learning/ddos/glossary/hypertext-transfer-protocol-http/"&gt;What is HTTP?&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;#article: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview"&gt;An Overview of HTTP&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;#article: &lt;a href="https://kamranahmed.info/blog/2016/08/13/http-in-depth/"&gt;Journey to HTTP/2&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;#video: &lt;a href="https://www.youtube.com/watch?v=iYM2zFP3Zn0&amp;amp;list=WL&amp;amp;index=4"&gt;HTTP Crash Course &amp;amp; Exploration&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
