<?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: Mahipal</title>
    <description>The latest articles on DEV Community by Mahipal (@nameismahipal).</description>
    <link>https://dev.to/nameismahipal</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%2F173540%2Fc4df0e41-1aa4-4b10-b207-512b9e86a46f.jpeg</url>
      <title>DEV Community: Mahipal</title>
      <link>https://dev.to/nameismahipal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nameismahipal"/>
    <language>en</language>
    <item>
      <title>CSS - Inheritance and Others</title>
      <dc:creator>Mahipal</dc:creator>
      <pubDate>Tue, 29 Dec 2020 18:11:40 +0000</pubDate>
      <link>https://dev.to/nameismahipal/css-inheritance-and-others-13l5</link>
      <guid>https://dev.to/nameismahipal/css-inheritance-and-others-13l5</guid>
      <description>&lt;p&gt;As i started learning Cascading, Specificity, Inheritance. Though at a higher level it was bit clear, but i felt difficulty in understanding what does &lt;code&gt;initial&lt;/code&gt;, &lt;code&gt;unset&lt;/code&gt; do. &lt;/p&gt;

&lt;p&gt;So i did some more learning, and learnt some more concepts in the process.&lt;/p&gt;

&lt;p&gt;So an element Style is set based on 3 different origins - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;User-agent origin&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;default styles used by the user's web browser. This is Used when no styles are applied. So on an empty CSS you can still see HTML has some styling applied. You could see h1 text is bigger than h2 text, and color is black, and there are margins applied aswell. This is Chrome browsers  &lt;a href="https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/html/resources/html.css;bpv=0"&gt;default style&lt;/a&gt;  defined that will be set to all its elements.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;User Origin&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;styles that user of the web browser has added using a developer tool or from a browser extension that automatically applies custom styles to content, such as Stylus or Stylish.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Author origin &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;style origin which contains all of the styles which are part of the document, whether embedded within the HTML or loaded from an external stylesheet file.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;CSS - &lt;code&gt;Cascading&lt;/code&gt; Style Sheets&lt;/p&gt;

&lt;h3&gt;
  
  
  When there Is or No Specified Value
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X_y2o94s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609262662107/rmS5SSIoQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X_y2o94s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609262662107/rmS5SSIoQ.png" alt="Screenshot 2020-12-29 at 22.54.12.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Other cases
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h1 { 
    color: red; 
}
h1 { 
    color: blue; 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have set same attribute style at multiple lines, (for the same element both have same specificity score), the last one will be applied. This is &lt;code&gt;Cascading&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#id-heading {
   color: green; 
}
.class-heading { 
    color: red; 
}
h1 { 
    color: blue; 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have set same attribute style via its element name or its class name or its id name, the one which has more specificity score to the element (here it is id name) will be applied. This is &lt;code&gt;Specificity&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;If we notice DOM Tree, there is a root, parents and children.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NyXvH0fD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609225960313/x3bjo4iYY.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NyXvH0fD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609225960313/x3bjo4iYY.png" alt="Screenshot 2020-12-29 at 12.42.34.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So a style applied to a parent element is passed on to its children elements. This is &lt;code&gt;inheritance&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Only Inherited Properties Ex: color, Font Size are passed on its children.&lt;br&gt;
Non-Inherited Properties Ex: border, width, margin, padding are NOT passed on to its children.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;An element can have same style attribute set with different values at multiple lines or different css files. But only one style will be set. &lt;/p&gt;

&lt;blockquote&gt;
&lt;h2&gt;
  
  
  &lt;code&gt;Cascade&lt;/code&gt;, &lt;code&gt;Specificity&lt;/code&gt;, &lt;code&gt;Inheritance&lt;/code&gt; will work together to compute the final style for an element.
&lt;/h2&gt;
&lt;/blockquote&gt;

&lt;p&gt;Inheritance is controlled by 4 different properties&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;inherit&lt;/li&gt;
&lt;li&gt;initial&lt;/li&gt;
&lt;li&gt;unset&lt;/li&gt;
&lt;li&gt;revert&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the below examples we will be looking at &lt;code&gt;color&lt;/code&gt; property and for &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; link element.&lt;/p&gt;

&lt;h3&gt;
  
  
  default style
&lt;/h3&gt;

&lt;p&gt;In the below example, when there is no CSS styles mentioned, you can see browsers default style (i.e., user agent) being applied to  . &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4EOfJQ29--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609229565342/yNxtaEChQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4EOfJQ29--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609229565342/yNxtaEChQ.png" alt="Screenshot 2020-12-29 at 13.42.32.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Inherit
&lt;/h3&gt;

&lt;p&gt;In the below example, when &lt;code&gt;inherit&lt;/code&gt; is set as a value to &lt;em&gt;color&lt;/em&gt; property for &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; element, it inherits its parents &lt;em&gt;color&lt;/em&gt; value.   Red arrows shows the default style is crossed which means its value is overridden.&lt;/p&gt;

&lt;p&gt;Brown color is applied.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bAtWeR0c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609235183199/WghJdBPvr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bAtWeR0c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609235183199/WghJdBPvr.png" alt="Screenshot 2020-12-29 at 15.15.12.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Initial
&lt;/h3&gt;

&lt;p&gt;For color property, it's usually Black.&lt;/p&gt;

&lt;p&gt;Initial value of a property is its initial value as listed in its &lt;a href="https://www.w3.org/TR/CSS2/propidx.html#q24.0"&gt;definition table&lt;/a&gt;  in CSS specification.&lt;/p&gt;

&lt;p&gt;In the below example, you can see browser default for link is crossed and overridden.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4M6-z41F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609242388860/X7saECGoI.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4M6-z41F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609242388860/X7saECGoI.png" alt="Screenshot 2020-12-29 at 17.15.10.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  unset
&lt;/h3&gt;

&lt;p&gt;When you set unset as a value to inherited property, it will act as &lt;code&gt;inherit&lt;/code&gt;, else if set to non-inherited property, it will act as &lt;code&gt;initial&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rRnWAPuQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609243702381/XBbLn8xQc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rRnWAPuQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609243702381/XBbLn8xQc.png" alt="Screenshot 2020-12-29 at 17.38.18.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;color is an inherited property, it will inherit value from its parent, here it is brown.&lt;br&gt;
padding is an non-inherited property, it will get initial value, which is 0px.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VfUaEJSN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609244955469/PX-AsDpdY.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VfUaEJSN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609244955469/PX-AsDpdY.png" alt="Screenshot 2020-12-29 at 17.59.06.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  revert
&lt;/h3&gt;

&lt;p&gt;As in the below example, When there is no style set, browsers default style is applied. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KpaKvEC4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609259535780/IBPIOhdQ2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KpaKvEC4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609259535780/IBPIOhdQ2.png" alt="Screenshot 2020-12-29 at 22.02.06.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you set revert on a property, and if that element has no parent, then default style of the browser (i.e., user agent) will be applied.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v2laPhE8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609259956574/vRqaJ_wMl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v2laPhE8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609259956574/vRqaJ_wMl.png" alt="Screenshot 2020-12-29 at 22.09.00.png"&gt;&lt;/a&gt;&lt;br&gt;
When you set revert on a property for an element, and if its parent has a style, then parent style will be applied.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bhIn1lhP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609259868947/Qj799Lx02.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bhIn1lhP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609259868947/Qj799Lx02.png" alt="Screenshot 2020-12-29 at 22.07.42.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  all
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;all&lt;/code&gt; is shorthand CSS property that resets all of an element's properties except unicode-bidi, direction, and CSS Custom Properties(variables).&lt;br&gt;
Ex: &lt;br&gt;
all: unset;&lt;br&gt;
all: inherit;&lt;br&gt;
all: initial;&lt;br&gt;
all: revert;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h1&gt;
  
  
  &lt;code&gt;!important&lt;/code&gt; will override all the above and will become most specific rule.
&lt;/h1&gt;


&lt;/blockquote&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.main {
    color: blue !important;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Specificity Score
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;below info directly taken from mdn&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The amount of specificity a selector has is measured using four different values -  (thousands, hundreds, tens, and ones) &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Thousands: Score one in this column if the declaration is inside a style attribute, aka inline styles. Such declarations don't have selectors, so their specificity is always 1000.&lt;/li&gt;
&lt;li&gt;Hundreds: Score one in this column for each ID selector contained inside the overall selector.&lt;/li&gt;
&lt;li&gt;Tens: Score one in this column for each class selector, attribute selector, or pseudo-class contained inside the overall selector.&lt;/li&gt;
&lt;li&gt;Ones: Score one in this column for each element selector or pseudo-element contained inside the overall selector.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The universal selector (*), combinators (+, &amp;gt;, ~, ' '), and negation pseudo-class (:not) have specificity score of 0.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--timPDaKb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609264449781/F7Kbn6jtH.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--timPDaKb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1609264449781/F7Kbn6jtH.png" alt="Screenshot 2020-12-29 at 23.24.02.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
/* specificity: 0101 */
#outer a {
    background-color: red;
}

/* specificity: 0201 */
#outer #inner a {
    background-color: blue;
}

/* specificity: 0104 */
#outer div ul li a {
    color: yellow;
}

/* specificity: 0113 */
#outer div ul .nav a {
    color: white;
}

/* specificity: 0024 */
div div li:nth-child(2) a:hover {
    border: 10px solid black;
}

/* specificity: 0023 */
div li:nth-child(2) a:hover {
    border: 10px dashed black;
}

/* specificity: 0033 */
div div .nav:nth-child(2) a:hover {
    border: 10px double black;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I think we both learned a bit from this post. cheers.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Web Browser Engine Overview : For Beginners</title>
      <dc:creator>Mahipal</dc:creator>
      <pubDate>Sat, 19 Dec 2020 13:54:51 +0000</pubDate>
      <link>https://dev.to/nameismahipal/web-browser-engine-overview-for-beginners-4967</link>
      <guid>https://dev.to/nameismahipal/web-browser-engine-overview-for-beginners-4967</guid>
      <description>&lt;p&gt;Website that you visit/read is a Document.&lt;/p&gt;

&lt;p&gt;As a human, when you write a Document on a Paper, or lets say print a Newspaper, you see Headlines and some part of the story below it, and links to remaining story on a different page. Some headlines will have full story below it. You see paragraphs break on to a new line, have space between them. You see different colors, images all over inserted at different places of the Page. You see different image sizes, different fonts and font sizes. But when you read, you know which is head line, which are different sub navigation pages, like Sports Page, Movie Page, Classifieds Page. You are human and you are able to recognize what is what. &lt;/p&gt;

&lt;p&gt;So, how can we help the Computer to do the same ?&lt;/p&gt;

&lt;p&gt;All the web pages are text or images mainly. Your web browser is the software application that can display/read text and recognise what is what, ** Only If you &lt;code&gt;Mark&lt;/code&gt; the text properly.** &lt;/p&gt;

&lt;p&gt;So, how do you &lt;strong&gt;Mark&lt;/strong&gt; the text, so that Browsers can differentiate which text is what ?&lt;/p&gt;

&lt;p&gt;Here comes the HTML - Hyper Text Markup Language, which is made up of different  &lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/Element" rel="noopener noreferrer"&gt;elements&lt;/a&gt;. When you apply these elements to your text, that text will get a meaning in a document. These elements when applied to some text, can give a different meaning like as a Headline, paragraph, line break, table, a list, navigation bar, article, header, footer, link etc. &lt;/p&gt;

&lt;p&gt;But what about people who are blind ? These differently abled people will use screen readers or  &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility" rel="noopener noreferrer"&gt;Accessibility&lt;/a&gt;  features which most of the devices support. Your Web Browsers support too. Even your iOS/Android device, Check your settings for this Accessibility feature. &lt;/p&gt;

&lt;p&gt;And so is the  &lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/Localization" rel="noopener noreferrer"&gt;Localization&lt;/a&gt;  as every reader wont read your language, and it is not limited to language conversion.&lt;/p&gt;

&lt;p&gt;These HTML elements will give additional information for these screen readers.&lt;/p&gt;

&lt;p&gt;`HTML is a Markup language to structure text file. And it is for the web.&lt;/p&gt;

&lt;p&gt;XML is another markup language which is a data-description language. XML allows users to define their own tags. This feature makes it more powerful, and can be used in many more other  &lt;a href="https://en.wikipedia.org/wiki/List_of_XML_markup_languages" rel="noopener noreferrer"&gt;applications&lt;/a&gt; , like&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SVG is based on XML&lt;/li&gt;
&lt;li&gt;Web services&lt;/li&gt;
&lt;li&gt; &lt;a href="https://www.w3.org/Math/whatIsMathML.html" rel="noopener noreferrer"&gt;MathML&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to present your Marked Up Text to the Users Visually by adding color or style or animation , you need &lt;code&gt;CSS (Cascading Style Sheets)&lt;/code&gt; a declarative language help which is a rule-based language.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A CSS rule is a set of properties associated with a selector. &lt;/li&gt;
&lt;li&gt;"Cascading" refers to the rules that govern how selectors are prioritized to change a page's appearance.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Declarative language - WHAT to do&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You tell your Car driver, just the house address where you want to go&lt;/li&gt;
&lt;li&gt;Ex: HTML, XML, CSS, JSON, SQL.&lt;/li&gt;
&lt;li&gt;Ex: Project Manager - tells - what to do&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Imperative language - HOW to do&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You tell your Car driver, street by street directions till the house address where you want to go&lt;/li&gt;
&lt;li&gt;Ex: C, C++, C#, Java, JavaScript, Scala, Python.&lt;/li&gt;
&lt;li&gt;Ex: Developer - figures out - how to do&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, a Declarative program will be executed by Imperative program.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Just like W3C who define web standards, CSS standards are done by &lt;a href="https://www.w3.org/Style/CSS/" rel="noopener noreferrer"&gt;CSS Working group&lt;/a&gt; within W3C.&lt;/p&gt;

&lt;p&gt;Okay, so CSS can be used to style HTML. Guess what? &lt;br&gt;
You can even style other Markup languages like  &lt;a href="https://www.geeksforgeeks.org/displaying-xml-using-css/" rel="noopener noreferrer"&gt;XML&lt;/a&gt; ,  &lt;a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_and_CSS" rel="noopener noreferrer"&gt;SVG &lt;/a&gt;,&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Mozilla/MathML_Project/test-mathml-css" rel="noopener noreferrer"&gt;MathML&lt;/a&gt;  with CSS.&lt;/p&gt;

&lt;p&gt;Web Standards is a work in progress document which keeps getting updated. Your favourite browser will keep implementing these standards and keep releasing new version updates. Below image is for illustration only.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608298073831%2FDHka53ksI.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608298073831%2FDHka53ksI.png" alt="Screenshot 2020-12-18 at 18.45.46.png"&gt;&lt;/a&gt;&lt;br&gt;
There is a possibility that all browsers may not be at the same implementation status. So, if you are using an element/property there is a chance that it may work in one browser and may not work in different one.&lt;/p&gt;

&lt;p&gt;Your Browser has different features that it is capable of doing but mainly is to &lt;a href="https://mahipal.dev/how-client-server-communication-works-for-dummies" rel="noopener noreferrer"&gt; communicate with web servers&lt;/a&gt; and display (or render) on Browsers window.&lt;/p&gt;

&lt;h2&gt;
  
  
  So, What happens within a Browser Engine?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608379854843%2FTV8208yaQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608379854843%2FTV8208yaQ.png" alt="Screenshot 2020-12-19 at 17.40.38.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Browser engine is the heart of the browser. It is tightly integrated with Render engine and JavaScript engine. So together, Browser engine takes care of Implementing Web Standards, DOM/CSS Parsing to Object Models, Calculating Styles, Layout, draw graphics, request resources from the network stack and others.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Some popular Browser Engines - WebKit, Blink, Gecko&lt;/p&gt;

&lt;p&gt;Some popular JavaScript Engines - JavaScriptCore, V8, SpiderMonkey&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Google Chrome uses Blink, V8.&lt;/p&gt;

&lt;p&gt;When we speak of Object, what is it really ? If you have heard of Object oriented programming, or if you are coming from Java/C++ background, you can easily relate. &lt;/p&gt;

&lt;p&gt;So here, we have these HTML elements and CSS selectors.&lt;/p&gt;

&lt;p&gt;Once these elements/selectors are loaded into memory (Parsed to Tokens, Nodes), browser provides uses that information and relate style elements to create a Render Tree, which then creates Layout which tells which object occupies which coordinates and its properties, and then Paints (renders) your screen accordingly for you to see.&lt;/p&gt;

&lt;p&gt;Browser allows us a way to create copies of these element/selector references (called objects), which we can use to interact with them programatically, like read or write to a paragraph or title, and many more things. &lt;/p&gt;

&lt;p&gt;HTML is converted to &lt;code&gt;DOM&lt;/code&gt; Tree. CSS is converted to &lt;code&gt;CSSOM&lt;/code&gt; Tree.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;DOM - Document Object Model for HTML. *(you know that web page is a document, right) * - is a set of APIs that allow manipulation of HTML from JavaScript&lt;/p&gt;

&lt;p&gt;CSSOM - CSS Object Model for CSS - is a set of APIs that allow manipulation of CSS from JavaScript.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API" rel="noopener noreferrer"&gt;WebAPI&lt;/a&gt;  - DOM, CSSOM are 2 of many other APIs that browser provides.&lt;/p&gt;

&lt;h2&gt;
  
  
  Render Engine
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608385341954%2F79ZNf0gnS.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608385341954%2F79ZNf0gnS.png" alt="Screenshot 2020-12-19 at 19.12.04.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;HTML and CSS document will be parsed by the Render engine. Parsing is done based on the language Vocabulary and Tokens are created. Syntax rules applied on Tokens and Nodes are created.&lt;/p&gt;

&lt;p&gt;Tokens which are converted to Objects are linked in a Tree Data Structure each separate for DOM and CSSOM. This Object Model will be used by the Browser for all further processing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608378634505%2F7CmRGJ3HU.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608378634505%2F7CmRGJ3HU.png" alt="Screenshot 2020-12-19 at 17.15.11.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608378630905%2FNNA_g5gVu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608378630905%2FNNA_g5gVu.png" alt="Screenshot 2020-12-19 at 17.15.24.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Browser blocks rendering untill it has both the DOM and CSSOM. CSS media types and media queries allow us to un-block rendering while CSSOM is being constructed as the page downloads.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
&amp;lt;link href="style.css" rel="stylesheet"&amp;gt;&lt;br&gt;
&amp;lt;link href="print.css" rel="stylesheet" media="print"&amp;gt;&lt;br&gt;
&amp;lt;link href="other.css" rel="stylesheet" media="(min-width: 40em)"&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;Browser combines both DOM, CSSOM into Render Tree, which captures all the visible content of the page, all its style information for each node. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608378624052%2FJFSvQmJ5p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608378624052%2FJFSvQmJ5p.png" alt="Screenshot 2020-12-19 at 17.20.00.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From Render Tree, Browser enters Layout creation stage, where it computes exact position and size of each object (in pixels) in the browser window.&lt;/p&gt;

&lt;p&gt;When Layout is complete, Browser issues &lt;code&gt;Paint Setup&lt;/code&gt; and &lt;code&gt;Paint&lt;/code&gt; events, which converts render tree to Pixels on the screen.&lt;/p&gt;

&lt;p&gt;JavaScript is written at the end of the body mainly because, JavaScript execution is parser blocking. Browser must pause DOM construction and hand over control to JavaScript runtime, and let script execute before proceeding with DOM construction.&lt;/p&gt;

&lt;p&gt;For detailed information, there is ton of material in google. &lt;/p&gt;

&lt;p&gt;Hope this post helped u gain some knowledge like it did to me.&lt;/p&gt;

</description>
      <category>chrome</category>
      <category>browser</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>git - part 2: for beginners</title>
      <dc:creator>Mahipal</dc:creator>
      <pubDate>Thu, 17 Dec 2020 06:26:16 +0000</pubDate>
      <link>https://dev.to/nameismahipal/git-part-2-for-beginners-46l5</link>
      <guid>https://dev.to/nameismahipal/git-part-2-for-beginners-46l5</guid>
      <description>&lt;p&gt;After  &lt;a href="https://mahipal.dev/git-part-1-for-beginners"&gt;that&lt;/a&gt; small talk, in this post let's use some git commands.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Additional Info:-&lt;/p&gt;

&lt;p&gt;For complete list of commands, refer  &lt;a href="https://git-scm.com/docs"&gt;this&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Refer &lt;a href="http://ndpsoftware.com/git-cheatsheet.html#loc=workspace;"&gt;this&lt;/a&gt; Visual Git Cheat Sheet.&lt;/p&gt;

&lt;p&gt;Refer  &lt;a href="https://githubtraining.github.io/training-manual/#/01_getting_ready_for_class"&gt;this&lt;/a&gt; for some detailed information.&lt;/p&gt;

&lt;p&gt;Refer  &lt;a href="https://github.com/joshnh/Git-Commands"&gt;this &lt;/a&gt; for commonly used commands.&lt;/p&gt;

&lt;p&gt;Git Client that i really like are &lt;a href="https://fork.dev/"&gt;Fork&lt;/a&gt; and  &lt;a href="https://www.git-tower.com/"&gt;Tower&lt;/a&gt;. Free are  &lt;a href="https://www.sourcetreeapp.com/"&gt;SourceTree&lt;/a&gt;  and  &lt;a href="https://desktop.github.com/"&gt;Github Desktop&lt;/a&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I have git setup already on my station.&lt;/p&gt;

&lt;p&gt;When we work with git, files will be moved into 4 different steps on your laptop/PC before moving to 5th step which is upstream repo on the cloud.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CfGoaIkR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608032615101/He4eXriN0.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CfGoaIkR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608032615101/He4eXriN0.jpeg" alt="Screenshot_15_12_20__17_10.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Stash&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;this is like files will be moved as draft copy, which is on stand by with &lt;code&gt;git stash push&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Workspace&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;this is the actual place where you add/update your files, and these are not yet tracked by git&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Staged area or Index area&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;this is the place where all your files reside when they are ready for version control after you say &lt;code&gt;git add .&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Local repository&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;once committed with &lt;code&gt;git commit -m "&amp;lt;msg&amp;gt;"&lt;/code&gt;, this is the place where your files reside and have a version name and control. From here they can be moved to Upstream Repository (github account in the cloud)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So, i have this fresh directory(0 bytes), and when you enter &lt;/p&gt;

&lt;p&gt;&lt;code&gt;git status&lt;/code&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;gives the status of files &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;you get an error saying &lt;em&gt;This is not a git repo&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yEfYRNf2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608033965430/siAWJ5Iu4.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yEfYRNf2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608033965430/siAWJ5Iu4.jpeg" alt="Screenshot_15_12_20__17_34.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So you need to setup every working directory to maintain different versions.&lt;/p&gt;

&lt;h1&gt;
  
  
  Initialization
&lt;/h1&gt;

&lt;p&gt;After &lt;code&gt;git init&lt;/code&gt;, &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;the directory gets initialized, and &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;git status&lt;/em&gt; Now says there are no commits made yet.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DZQUa6Ed--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608034695660/ght0e90RE.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DZQUa6Ed--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608034695660/ght0e90RE.png" alt="3.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Though the directory looks empty, its size has increased from 0 to X bytes. So what changed ? &lt;em&gt;git init&lt;/em&gt; will create a hidden folder &lt;strong&gt;.git&lt;/strong&gt;, which tracks all the changes to this directory. It looks like this, if you see the hidden folder.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NZ6W2SxV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608035388537/MP5liTLlj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NZ6W2SxV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608035388537/MP5liTLlj.png" alt="4.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now i have added 1 text file and added 1 statement to it. When i say &lt;code&gt;git status&lt;/code&gt; it will still say No commits yet, but is tracking the files.&lt;/p&gt;

&lt;h1&gt;
  
  
  Moving to Staging area
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sIkliHwp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608039832888/OGF3m6vSe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sIkliHwp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608039832888/OGF3m6vSe.png" alt="5.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add .&lt;/code&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;this will move all the files to the staging area&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you have more than 1 file, but you want to add only 1 file to the staging area, then use &lt;br&gt;
&lt;code&gt;git add &amp;lt;file/folder name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;this will move specific file/folder name to the staging area (also called Index area)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QMcGVgW1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608084568340/nYiDrXOzC.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QMcGVgW1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608084568340/nYiDrXOzC.png" alt="7.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6SABvrzG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608084772310/KCGvykFXl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6SABvrzG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608084772310/KCGvykFXl.png" alt="8.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Moving to Local repo
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;git commit -m &amp;lt;commit message&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;this will commit all the files from staging area to the local repository. Your saving point in the history, which you can comeback to at a later point. In previous  &lt;a href="https://mahipal.dev/git-part-1-for-beginners"&gt;post&lt;/a&gt; , its like going to be version history, like Earth.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Bn8szwxg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608085894273/MRaPhur3A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Bn8szwxg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608085894273/MRaPhur3A.png" alt="9.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  update, stage, commit
&lt;/h2&gt;

&lt;p&gt;Updating both the files and adding to the staging area and then committing to local repo&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mbOpXJjk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608091194152/q99YqOOX6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mbOpXJjk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608091194152/q99YqOOX6.png" alt="11.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Moving to Upstream repo
&lt;/h1&gt;

&lt;p&gt;To move the files from your local PC to your github account, there should be a link established between the two. Create a repository in your github account. &lt;/p&gt;

&lt;p&gt;If you have cloned the repository, there is git already initialized and already a link established. Check by &lt;code&gt;git remote -v&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To establish link between Local PC and Github repo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git remote add origin &amp;lt;https://github.com/username/repo-name.git&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It will now add your github repo as the origin from which you can push your changes and pull updates to your local PC.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RVNCkUDh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608095339935/shcXFJj-o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RVNCkUDh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608095339935/shcXFJj-o.png" alt="16.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;to Push updates to your Upstream repo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push -u origin &amp;lt;branch name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;origin&lt;/code&gt; is your upstream repo from where you can fetch/push&lt;br&gt;
&lt;code&gt;branch name&lt;/code&gt; here it is master&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--twcHpCkh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608096077391/9uDjwA57W.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--twcHpCkh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608096077391/9uDjwA57W.png" alt="17.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Head, Branch and Merge
&lt;/h1&gt;

&lt;p&gt;Till now you have a stable code. &lt;/p&gt;

&lt;p&gt;Now you want to build a new feature, but do not want to disturb your stable code, and work from a different copy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3ZQgJuXu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608102913499/oEPdJ2BVN.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3ZQgJuXu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608102913499/oEPdJ2BVN.png" alt="18.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So for that, You can create a branch, which will have all the old code and you can start creating the new feature on top of it. Once you think your feature is working properly, you can merge your new code with old code. Suppose if your new code is not working properly or at a later point you think it will not be useful, you can delete the branch without having to worry about loosing your old code.&lt;/p&gt;

&lt;p&gt;Just like a Tree having a Trunk which is the main/master branch, and there are side branches which are coming out of the Master branch at different places, &lt;/p&gt;

&lt;p&gt;in &lt;strong&gt;git&lt;/strong&gt;, you can create new side branches from existing code &lt;em&gt;(from Master/any branch)&lt;/em&gt;, make updates, the only difference from actual tree is that, you can merge your new updates to master/any branch. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Head&lt;/strong&gt; is how the git knows on which branch you are on currently.&lt;br&gt;
&lt;strong&gt;Detached Head&lt;/strong&gt; is like if you move from current state to a older commit like Commit 1, you are in detached head state. This can be done by &lt;code&gt;git checkout &amp;lt;commitCode&amp;gt;&lt;/code&gt;. commit code can be found using git logging commands.&lt;/p&gt;

&lt;p&gt;To view the list of branches, run &lt;/p&gt;

&lt;p&gt;&lt;code&gt;git branch&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;it will list all the branches on your local repo&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;git branch -a&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;this will list all the branches from local repo and remote repo&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To create a new branch, &lt;code&gt;git branch &amp;lt;branch-name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;At this point, your Head will still be at master branch, as you have only created but  not moved.&lt;/p&gt;

&lt;p&gt;to move, &lt;code&gt;git checkout &amp;lt;branch-name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Creating and moving your Head to new branch can be done with single command&lt;br&gt;
&lt;code&gt;git checkout -b &amp;lt;branch-name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let us create a new branch named &lt;em&gt;feature-1&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MOtTsjqj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608179518676/ku_WB8-R1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MOtTsjqj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608179518676/ku_WB8-R1.png" alt="19.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lets update few lines, add to stage and commit.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--latEJmNe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608179524867/wAhRpYmxA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--latEJmNe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608179524867/wAhRpYmxA.png" alt="20.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All the updates are commited in your new feature-1 branch.&lt;/p&gt;

&lt;p&gt;Now, if you switch to your Master branch, you will not see any of the updates made in your feature-1 branch. So both branches are being maintained separately.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PNIIYLnx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608179564330/alvCbW7Pm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PNIIYLnx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608179564330/alvCbW7Pm.png" alt="21.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you feel that feature-1 updates working properly and you want to include in to your Master branch, so for that you need to merge.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git merge &amp;lt;branch-name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;merges all updates from your &lt;strong&gt;branch-name&lt;/strong&gt; into your Head&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Lets say you now at feature-1 branch &lt;em&gt;(and there are no changes to your Master branch since your new branch creation)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;when you say &lt;code&gt;git merge master&lt;/code&gt; - tool says Already up to date. because your Head is at feature-1, and all the updates from your master branch are already in your feature-1 branch&lt;/p&gt;

&lt;p&gt;change your head to master by &lt;code&gt;git checkout master&lt;/code&gt; and say &lt;code&gt;git merge feature-1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fFd7uxLB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608183988388/Zv5iZ9Jm4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFd7uxLB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608183988388/Zv5iZ9Jm4.png" alt="22.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Push to upstream
&lt;/h3&gt;

&lt;p&gt;Now you can push your main branch updates to upstream&lt;br&gt;
&lt;code&gt;git push origin&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YYIwnfjJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608185744211/07AbvzlNe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YYIwnfjJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608185744211/07AbvzlNe.png" alt="23.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can even push your new branch to upstream&lt;br&gt;
&lt;code&gt;git push -u origin &amp;lt;branch-name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tlq5s9eG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608185767350/9_i54zfKn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tlq5s9eG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608185767350/9_i54zfKn.png" alt="25.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Log
&lt;/h1&gt;

&lt;p&gt;To view changes&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git log&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;shows all the changes&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UAvtqAPj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608091241493/Y2fB_tvdB.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UAvtqAPj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608091241493/Y2fB_tvdB.png" alt="12.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;git log --summary&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;shows all the changes with some additional details&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--92TNsEtK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608091246811/FRod-V6GM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--92TNsEtK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608091246811/FRod-V6GM.png" alt="13.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;git log --oneline&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;shows all the commits in single line&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1BtpIZhN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608091262852/ZQREip_8N.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1BtpIZhN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608091262852/ZQREip_8N.png" alt="14.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;git shortlog&lt;/code&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--O1FPbtmi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608091715872/HRa_22pvq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--O1FPbtmi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1608091715872/HRa_22pvq.png" alt="15.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conflicts
&lt;/h1&gt;

&lt;p&gt;When you are merging 2 files with same filenames, and if there is code/text on the same line numbers on both the files, then there will be conflict and merge will not happen right away.&lt;/p&gt;

&lt;p&gt;We can discuss on conflicts and others commands in a different post.&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>beginners</category>
    </item>
    <item>
      <title>git - part 1: for Beginners</title>
      <dc:creator>Mahipal</dc:creator>
      <pubDate>Thu, 10 Dec 2020 17:21:51 +0000</pubDate>
      <link>https://dev.to/nameismahipal/git-part-1-for-beginners-4ekj</link>
      <guid>https://dev.to/nameismahipal/git-part-1-for-beginners-4ekj</guid>
      <description>&lt;p&gt;Hey, do you remember about &lt;code&gt;Safety Net&lt;/code&gt; that I mentioned  &lt;a href="https://mahipal.dev/client-tool-classification"&gt;here&lt;/a&gt;.  Ya, &lt;code&gt;Git&lt;/code&gt; falls under this classification, its Source Code Control. &lt;/p&gt;

&lt;p&gt;More like version control. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;Git&lt;/code&gt; - is a version control software tool.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Github&lt;/code&gt; - is a Repository. Mainly used for code/projects. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;(just like Google Drive - is a repository of all your documents/pictures/other files).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;lets say &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Today, you write 10 lines of code - lets call that &lt;em&gt;version-1&lt;/em&gt;. &lt;/li&gt;
&lt;li&gt;Tomorrow, you edit 2 lines and add 5 more lines of code  - now its &lt;em&gt;version-2&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Later, You/Someone else, will add/update another few lines of code - now its &lt;em&gt;version-3&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now you want to go back to version-1 (or any other version) - Sure thing. possible with Version Control Software/Tool. Finally We &lt;em&gt;Don't&lt;/em&gt; need to create folders each day to say Day1_code, Day2_Code,...&lt;/p&gt;

&lt;p&gt;Maybe you must have seen this in google docs (also similar in Microsoft docs)&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vsDddiJD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1607562354837/mGn6liUeT.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vsDddiJD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1607562354837/mGn6liUeT.jpeg" alt="Screenshot_10_12_20__06_26.jpg"&gt;&lt;/a&gt; &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--evv6zkEZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1607563857404/wN8PXj0hx.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--evv6zkEZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1607563857404/wN8PXj0hx.jpeg" alt="Screenshot_10_12_20__06_56.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You see , there are different versions of the above document and so different features in your google drive. Similarly in &lt;code&gt;Git&lt;/code&gt;, there are different features and commands for those features. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;you can create a document.&lt;br&gt;
&lt;br&gt;
&lt;code&gt;In Git, you say `git Init`&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;daily add some content to it,&lt;br&gt;
&lt;br&gt;
&lt;code&gt;In Git, you say `git add .`&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;you can name each version.&lt;br&gt;
&lt;br&gt;
&lt;code&gt;In Git, you say `git commit -m `Earth Topic`&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Lets say Yesterday you wrote about Mars, name that version Mars and Today you wrote about Earth, so name that version as Earth, that will be easier for you to switch to previous date/version or to identify all the versions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;google docs has Auto Save. Or you manually Click Save.

&lt;code&gt;In Git, you say `git push`&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;move(restore) document to any of the previous date,&lt;br&gt;
&lt;br&gt;
&lt;code&gt;In Git, you say `git checkout [branch-name]`&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You/(like many others) can get access (collaborate) to other peoples google drive documents, and your can update the your changes to the original document&lt;br&gt;
&lt;br&gt;
&lt;code&gt;In Git, this is called pull request&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;and you can get latest updated document and see all the new changes.&lt;br&gt;
&lt;br&gt;
&lt;code&gt;In Git, this is called `git pull&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In Git, there are many other features, and many other technical terms to know of.&lt;/p&gt;

&lt;p&gt;If you do not have a github account, create one.&lt;/p&gt;

&lt;p&gt;and Now you can do 2 things. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;work on your own project, and upload/maintain your code in your github account.
&amp;gt; use &lt;code&gt;git commands&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;work on others project i.e, collaborate, or use others project and make changes and run it independently based on its licence, from your github account.
&amp;gt; use &lt;code&gt;fork&lt;/code&gt;, &lt;code&gt;clone&lt;/code&gt; and &lt;code&gt;git commands&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you go into others repositories, (this is your origin repository) you can see &lt;code&gt;fork&lt;/code&gt; and &lt;code&gt;clone&lt;/code&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HeiJSfHU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1607616311519/8t34gkKTW.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HeiJSfHU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1607616311519/8t34gkKTW.jpeg" alt="Screenshot_10_12_20__21_33.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Usual steps when you Fork or Clone
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MAGIw7oC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1607620265470/7jeOf_9lM.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MAGIw7oC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1607620265470/7jeOf_9lM.jpeg" alt="Screenshot_10_12_20__22_40.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;fork&lt;/th&gt;
&lt;th&gt;clone&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;click on &lt;code&gt;fork&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;use &lt;code&gt;git clone&lt;/code&gt; command&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1. downloads a copy to your github account&lt;/td&gt;
&lt;td&gt;1. downloads a copy to your local machine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2. clone the repository to your local machine&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3. make changes on your machine&lt;/td&gt;
&lt;td&gt;2. make changes on your machine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4. push changes to your github repo&lt;/td&gt;
&lt;td&gt;3. push changes to your github repo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5. send &lt;em&gt;Pull Request Command&lt;/em&gt; to send changes to Original repo&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6. If original repo Owner accepts your changes, your code will be merged&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;I will write &lt;code&gt;another post&lt;/code&gt; on some of the commands and about the work flow.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you liked the content, please free to follow me on  &lt;a href="https://twitter.com/sayamahi"&gt;twitter&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Part 2 of the post is &lt;a href="https://mahipal.dev/git-part-1-for-beginners"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How Client-Server Communication Works: For Dummies</title>
      <dc:creator>Mahipal</dc:creator>
      <pubDate>Tue, 01 Dec 2020 14:17:48 +0000</pubDate>
      <link>https://dev.to/nameismahipal/how-client-server-communication-works-for-dummies-nlf</link>
      <guid>https://dev.to/nameismahipal/how-client-server-communication-works-for-dummies-nlf</guid>
      <description>&lt;p&gt;Some point in your life, You may have had connected your Mobile device to your friends Mobile device via Bluetooth or Lets say you did. You can even send a file or receive a file or Accept an incoming file or Reject or Close the connection. You can do various actions.(or lets say methods). Here we do not care how your image file or audio file is being sent from your Mobile to your friend Mobile. All you care about is weather it is successfully reached or not. &lt;/p&gt;

&lt;p&gt;Here these two Mobile devices are able to communicate/send or receive data via Bluetooth Protocol (as both the devices have Bluetooth Protocol Stack implemented). You don't care how it is working internally, you just use the above discussed actions(or methods) and get your work done.&lt;/p&gt;

&lt;p&gt;Similarly, your web browser needs a way to communicate with another browser or application. Your browser should be able to Receive and Send data to another web browser (or application). Here comes  HTTP  (Hyper Text Transfer Protocol), which is an application level protocol, that sits above communication protocol  &lt;a href="https://en.wikipedia.org/wiki/Internet_protocol_suite"&gt;TCP/IP&lt;/a&gt; . So if you browser has to send/get any data that your are reading now, HTTP plays the role (with few other underneath protocols).  What are the different actions here ? Read  &lt;a href="https://dev.opera.com/articles/http-basic-introduction/"&gt;this&lt;/a&gt; to speak HTTP.&lt;/p&gt;

&lt;p&gt;Just like when you get the audio file via Bluetooth, to listen you would need MP3 audio player Software. Similarly, once data reaches your browser, you need help of other Software for you to read. Same is for Sending. Consider them as HTML, CSS, JS(JavaScript).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--m5ehYTmj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1606823214174/wPNfWZ6HsL.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m5ehYTmj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1606823214174/wPNfWZ6HsL.png" alt="simple-client-server.png"&gt;&lt;/a&gt;&lt;br&gt;
Image Source: MDN&lt;/p&gt;

&lt;p&gt;Now, when you type some web address like &lt;a href="http://www.apple.com"&gt;www.apple.com&lt;/a&gt;, your browser (Chrome, Safari, Firefox, Edge etc) sends some request to another computer (server), server will send back some data/images/files, and browser will parse, and now you can see all the products with beautiful images.&lt;br&gt;
Okay, will my request directly reaches Apples server ? Nope. Read  &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/Common_questions/How_does_the_Internet_work"&gt;this &lt;/a&gt; if you want to know.&lt;/p&gt;

&lt;p&gt;Typically, HTTP request / response handshake is &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;browser requests&lt;/th&gt;
&lt;th&gt;server returns&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;HTML page&lt;/td&gt;
&lt;td&gt;an HTML file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a style sheet&lt;/td&gt;
&lt;td&gt;a CSS file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;an JPG image&lt;/td&gt;
&lt;td&gt;a JPG file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JavaScript code&lt;/td&gt;
&lt;td&gt;a JS file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;data&lt;/td&gt;
&lt;td&gt;data (in XML or JSON)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These Servers are built and Maintained by Companies like Apple/Google/AWS/Digital Ocean/ where all the data will be hosted. Some are not open to public and some are.&lt;/p&gt;

&lt;p&gt;Lets put the same in an example.&lt;br&gt;
So, there is a nice Restaurant around. Restaurant owner has few Servers (or Bearers) working for him. You decide to visit and go to this Restaurant, For the restaurant owner you are a Client. So, You reach the restaurant which is on a particular street and building,  you find restaurants beautiful carpets, nice paint, nice decorations and you feel nice. You  find a table to sit and order what you want to the Server. Server goes back inside to bring what you ordered, Meanwhile you may make a call or play a game or just do nothing. Once the food is ready, your Server is back with food and it is served, and you Consume the food, and leave the Restaurant.&lt;/p&gt;

&lt;p&gt;If we break this story further down,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;there is restaurant on a particular street/building -&amp;gt; Unique Address, called 'IP Address' which is in digits. As it is difficult to remember we use domain names that later gets translated. We use web address in browsers.&lt;/li&gt;
&lt;li&gt;you reach the restaurant via road -&amp;gt; your Internet connection&lt;/li&gt;
&lt;li&gt;restaurant has many rooms and floors -&amp;gt; built with HTML&lt;/li&gt;
&lt;li&gt;restaurant has beautiful carpets/wall paints/decorations -&amp;gt; built with CSS&lt;/li&gt;
&lt;li&gt;there is a table to sit and eat in one room -&amp;gt; webpage with some user actions/entry&lt;/li&gt;
&lt;li&gt;there are restrooms in another room -&amp;gt; another webpage&lt;/li&gt;
&lt;li&gt;lights are running when a switch is enabled, water runs when tap is opened -&amp;gt; JS can make this runnnig&lt;/li&gt;
&lt;li&gt;you are able to communicate to server and request food by saying GET that food-&amp;gt; send Request to Server via JS through HTTP using GET method. Beware that Server could also say OK (food if available) or BAD Request (Sorry Food Not available).&lt;/li&gt;
&lt;li&gt;the food is being prepared -&amp;gt; Server Computer is reading the data&lt;/li&gt;
&lt;li&gt;server is able to get food back to you -&amp;gt; get Response from Server via HTTP (can be multiple responses) and JS parses the data.&lt;/li&gt;
&lt;li&gt;you eat -&amp;gt; data from Server is being read/viewed&lt;/li&gt;
&lt;li&gt;you leave the place -&amp;gt; close the website.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;Websites are primarily built using HTML, CSS, JavaScript and&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;&lt;code&gt;Browsers communicate with Servers using HTTP and they understand HTML, CSS, JS&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Using HTTP, you can Create, Read, Update, Delete Operations on the Server.&lt;/p&gt;

&lt;p&gt;Just like 'GET', other HTTP Methods are&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GET (Read)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Requests using GET should only retrieve data and should have no other effect. &lt;/p&gt;

&lt;p&gt;Ex: Returns Item Inventory list, Find Purchase order by ID&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;HEAD&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;The HEAD method asks for a response identical to that of a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content.&lt;/p&gt;

&lt;p&gt;same as GET, except it does not have response body.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;POST (Create)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;POST requests are used to send data to the Server. Data is stored in the request body of HTTP request&lt;/p&gt;

&lt;p&gt;The POST method requests that the server accept the entity enclosed in the request as a new subordinate of the web resource identified by the URI. The data POSTed might be, for example, an annotation for existing resources;  a block of data that is the result of submitting a web form to a data-handling process; or an item to add to a database.&lt;/p&gt;

&lt;p&gt;Ex: Place an Order for an Item&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;PUT (Update/Replace)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;The PUT method requests that the enclosed entity be stored under the supplied URI. If the URI does not point to an existing resource, then the server can create the resource with that URI.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;DELETE (Delete)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;The DELETE method deletes the specified resource.&lt;/p&gt;

&lt;p&gt;Ex: Delete purchase order by ID&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;TRACE&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;The TRACE method echoes the received request so that a client can see what changes or additions have been made by intermediate servers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;OPTIONS&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;The OPTIONS method returns the HTTP methods that the server supports for the specified URL. This can be used to check the functionality of a web server by requesting '*' instead of a specific resource.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;CONNECT&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;The CONNECT method converts the request connection to a transparent TCP/IP tunnel, usually to facilitate SSL-encrypted communication (HTTPS) through an unencrypted HTTP proxy.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;PATCH (Update/Modify)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;The PATCH method applies partial modifications to a resource.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Just like Server saying 'OK', HTTP response codes are&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;1xx (Informational): Request received, continuing process.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;2xx (Successful): The action was successfully received, understood, and accepted.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;3xx (Redirection): Further action needs to be taken in order to complete the request.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;4xx (Client Error): The request contains bad syntax or cannot be fulfilled.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;5xx (Server Error): The server failed to fulfil an apparently valid request.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Client Tool Classification</title>
      <dc:creator>Mahipal</dc:creator>
      <pubDate>Tue, 01 Dec 2020 02:35:28 +0000</pubDate>
      <link>https://dev.to/nameismahipal/client-tool-classification-2p4p</link>
      <guid>https://dev.to/nameismahipal/client-tool-classification-2p4p</guid>
      <description>&lt;p&gt;Cover Image Source: &lt;a href="https://medium.com/@withinsight1/the-front-end-spectrum-c0f30998c9f0"&gt;https://medium.com/@withinsight1/the-front-end-spectrum-c0f30998c9f0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, though you are a beginner or expect, you would be using lot of tools that aid in code development, its testing, fixing any errors,  making it public/live, hence making your life easier.&lt;/p&gt;

&lt;p&gt;All of these tools would mainly be classified into 3 categories.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;1. Safety Net Tools&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;these tools are useful during code development. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;2. Transformation Tools&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;these tools transform your code. Like one language/syntax to another.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;3. Post-development Tools&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;these tools are helpful during testing and deployment.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Few examples under each category:&lt;/p&gt;

&lt;h3&gt;
  
  
  Safety Net
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Linters

&lt;ul&gt;
&lt;li&gt; &lt;a href="https://eslint.org/"&gt;Eslint&lt;/a&gt; 
&amp;gt; a highly configurable tool for catching potential syntax errors and encouraging "best practices"&lt;/li&gt;
&lt;li&gt; &lt;a href="http://csslint.net/"&gt;csslint&lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href="https://webhint.io/"&gt;webhint&lt;/a&gt; 
&amp;gt; that surfaces best practices including approaches to accessibility, performance, cross-browser, security, testing for PWAs etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Source Code Control (version control)

&lt;ul&gt;
&lt;li&gt;SVN&lt;/li&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Code Formatters

&lt;ul&gt;
&lt;li&gt; &lt;a href="https://prettier.io/"&gt;Prettier&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Bundlers/Packagers
&amp;gt;these get your code ready for production. Some features are like removing unnecessary spaces which reduces the size (minifying), removing unnecessary lib's that your code is not using (tree-shaking).&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt; &lt;a href="https://parceljs.org/"&gt;Parcel&lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href="https://webpack.js.org/"&gt;Webpack&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Transformation
&lt;/h3&gt;

&lt;p&gt;These Tools convert Code to browser-compatible code&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Write code using latest language features, and have it transformed which works on most of the devices including old browsers that don't support these features in native lang.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;a href="https://babeljs.io/"&gt;Babel &lt;/a&gt; 
&amp;gt; JavaScript compiler that allows developers to write their code using cutting-edge JavaScript, which Babel then takes and converts into old-fashioned JavaScript that more browsers can understand&lt;/li&gt;
&lt;li&gt; &lt;a href="https://postcss.org/"&gt;PostCSS&lt;/a&gt; 
&amp;gt;allows to write cutting-edge latest CSS. If there is no equivalent way in old browsers, PostCSS will install JavaScript polyfill to emulate the same behavior.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Write code in entirely different language and have it transformed&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;a href="https://sass-lang.com/"&gt;Sass/SCSS&lt;/a&gt; 
&amp;gt; allows you to use variables, nested rules, functions and other features some of which are not available in native.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.typescriptlang.org/"&gt;TypeScript&lt;/a&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;superset of JavaScript that provides additional features. TypeScript compiler will covert Typescript Code to JavaScript when building for production.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Frameworks: React, Ember, Vue etc
&amp;gt; built on top of vanilla JS, allows you to use custom syntax, which later be transformed.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Post-development
&lt;/h3&gt;

&lt;p&gt;This makes sure that your code makes it to servers and continues to run.&lt;br&gt;
This stage runs mostly automatically, unless there is an issue.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Testing &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Frameworks for writing test

&lt;ul&gt;
&lt;li&gt; &lt;a href="https://jestjs.io/"&gt;Jest&lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href="https://mochajs.org/"&gt;Mocha&lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href="https://jasmine.github.io/"&gt;Jasmine&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Automated tests

&lt;ul&gt;
&lt;li&gt; &lt;a href="https://travis-ci.org/"&gt;Travis CI&lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href="https://www.jenkins.io/"&gt;Jenkins&lt;/a&gt; &lt;/li&gt;
&lt;li&gt; &lt;a href="https://circleci.com/"&gt;Circle CI&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Deployment&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;tools to get your site published

&lt;ul&gt;
&lt;li&gt;Netlify&lt;/li&gt;
&lt;li&gt;Vercel&lt;/li&gt;
&lt;li&gt;Github Pages&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Auditing Tools/Quality/etc&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://codeclimate.com/"&gt;Code Climate&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://probot.github.io/"&gt;Github bots&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://updown.io/"&gt;Updown&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Exhaustive List of Tools:&lt;br&gt;
&lt;a href="https://frontendmasters.com/books/front-end-handbook/2019/#6"&gt;https://frontendmasters.com/books/front-end-handbook/2019/#6&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Source:  &lt;a href="https://developer.mozilla.org/en-US/"&gt;MDN&lt;/a&gt; &lt;/p&gt;

</description>
      <category>tooling</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>"&lt;!DOCTYPE html&gt;"</title>
      <dc:creator>Mahipal</dc:creator>
      <pubDate>Sun, 29 Nov 2020 07:13:53 +0000</pubDate>
      <link>https://dev.to/nameismahipal/doctype-html-56f4</link>
      <guid>https://dev.to/nameismahipal/doctype-html-56f4</guid>
      <description>&lt;p&gt;When i started learning html few days ago, i used to forget mentioning &lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I thought learning more about it, i will start forgetting less.&lt;/p&gt;

&lt;p&gt;So, What does it mean ? What happens if you don't or want to write ? Why should you  write it at all ? and also in the beginning of the file and not in second line or after.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;br&gt;
 &lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;! &amp;gt;&lt;/code&gt; markup declaration, that is carried forward from earlier versions of HTML. To let browser know that, &lt;code&gt;&amp;lt;! This is HTML version x.x document !&amp;gt;&lt;/code&gt; or  &lt;code&gt;&amp;lt;!-- This is comment -- &amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;DOCTYPE&lt;/code&gt; - Documentation Type&lt;/p&gt;

&lt;p&gt;&lt;code&gt;html&lt;/code&gt; - version of HTML. Here it means HTML5.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Some History
&lt;/h3&gt;

&lt;p&gt;Back old days, Web Browser was first developed in 1990 and &lt;a href="http://www.ncsa.illinois.edu/enabling/mosaic"&gt;NCSA Mosaic&lt;/a&gt; was the first browser to display images and text simultaneously and led to the Internet Boom.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Netscape Navigator&lt;/code&gt; developed by Netscape which employed many of the original Mosaic authors. Firefox is the successor to Netscape, as the Mozilla community was created by Netscape in 1998 before their acquisition by AOL.&lt;/p&gt;

&lt;p&gt;Spyglass, Inc. licensed the technology and trademarks from NCSA for producing its own web browser, Microsoft  &lt;a href="https://en.wikipedia.org/wiki/Mosaic_(web_browser)"&gt;licensed&lt;/a&gt; Spyglass Mosaic and later purchased.&lt;/p&gt;

&lt;p&gt;Among few other players, Netscape and Microsoft had majority market share. Both Microsoft and Netscape liberally incorporated proprietary extensions to HTML in their products, and tried to gain an edge by product differentiation.&lt;/p&gt;

&lt;p&gt;If you want more on this,  &lt;a href="https://en.wikipedia.org/wiki/History_of_the_web_browser"&gt;this&lt;/a&gt; is the place.&lt;/p&gt;

&lt;p&gt;Though W3C is in place many did not follow while developing their browsers.  &lt;a href="https://www.w3.org/QA/2002/04/Web-Quality"&gt;Here&lt;/a&gt;  you can find what others opined back then.&lt;/p&gt;

&lt;h3&gt;
  
  
  Back to Present
&lt;/h3&gt;

&lt;p&gt;Major upgrade of HTML Web Standards is v5.0 (W3C and WHATWG were working together)&lt;/p&gt;

&lt;p&gt;W3C earlier documented all the standards/api's at  &lt;a href="https://webplatform.github.io/"&gt;WebPlatform&lt;/a&gt;  and Later moved to  &lt;a href="https://en.wikipedia.org/wiki/MDN_Web_Docs"&gt;MDN&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;As of today, Most of the browsers support these recommended standards, called &lt;code&gt;Full Standards Mode&lt;/code&gt; i.e., the behavior described by the HTML and CSS specifications&lt;/p&gt;

&lt;p&gt;So by writing &lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/code&gt; in the first line of your file, you are telling the Browsers to render the content based on the Full Standards Mode.&lt;/p&gt;

&lt;p&gt;Here comes other 2 modes&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;a href="https://developer.mozilla.org/en-US/docs/Mozilla/Mozilla_quirks_mode_behavior"&gt;Quirks Mode&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;this emulates browser behaviour as that of old legacy browsers.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt; &lt;a href="https://developer.mozilla.org/en-US/docs/Mozilla/Gecko_Almost_Standards_Mode"&gt;Almost Standards Mode&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;this has few behaviours implemented from Quirks mode.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The only purpose of DOCTYPE is for the browser is to know on which mode rendering has to be. (and as to prevent entering Quirks mode as default).&lt;/p&gt;

&lt;p&gt;Even if you write a comment on the first line and second line as DOCTYPE, your browser will enter quirks mode, and you will see unexpected behaviour.&lt;/p&gt;

&lt;p&gt;But what if you want to support your content on old Browsers i.e., before HTML 5.0, Nah. There is no reason that you want to spin your head on that. &lt;br&gt;
But if you want to really to support Legacy browsers or give a try, &lt;a href="https://html.com/tags/doctype/"&gt;this&lt;/a&gt; is the link.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>html</category>
      <category>css</category>
    </item>
  </channel>
</rss>
