<?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: Karthik-Prabhu-kp</title>
    <description>The latest articles on DEV Community by Karthik-Prabhu-kp (@karthikprabhukp).</description>
    <link>https://dev.to/karthikprabhukp</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F539690%2F74212789-4ff6-4968-9492-946293dfd21a.png</url>
      <title>DEV Community: Karthik-Prabhu-kp</title>
      <link>https://dev.to/karthikprabhukp</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/karthikprabhukp"/>
    <language>en</language>
    <item>
      <title>Common CSS Methodologies and BEM</title>
      <dc:creator>Karthik-Prabhu-kp</dc:creator>
      <pubDate>Tue, 15 Dec 2020 17:41:41 +0000</pubDate>
      <link>https://dev.to/karthikprabhukp/common-css-methodologies-and-bem-2063</link>
      <guid>https://dev.to/karthikprabhukp/common-css-methodologies-and-bem-2063</guid>
      <description>&lt;p&gt;When we code small sites it usually does not matter how we organize the styles. However, when it comes to larger, more complex projects, how you organize your code is the key to efficiency in at least these three ways: it affects how long it takes you to write code, how much of that code you’ll have to write and how much loading your browser will have to do.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a CSS Methodology?
&lt;/h2&gt;

&lt;p&gt;A CSS methodology is a set of guidelines for writing modular, reusable and scalable code.&lt;/p&gt;

&lt;h2&gt;
  
  
  some of the common CSS Mythologies.
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Object-Oriented CSS (OOCSS)
&lt;/h3&gt;

&lt;p&gt;In OOCSS the structure is separated from the skin. The methodology makes a clear distinction between content and its containers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Atomic CSS
&lt;/h3&gt;

&lt;p&gt;In this method we define single-purpose class selectors for every reusable declaration. In other words create a class selector for every repeating CSS declaration. This allows ease in maintaining consistent code and not having to invent classes for components requiring a single CSS rule.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scalable and Modular Architecture for CSS
&lt;/h3&gt;

&lt;p&gt;SMACSS works by dividing CSS into five categories – base, layout, module, state and theme – commonly split into separate files.SMACSS provides well-organised CSS code split logically across multiple files.&lt;/p&gt;

&lt;h3&gt;
  
  
  BEM
&lt;/h3&gt;

&lt;p&gt;BEM (Block, Element, Modifier) is a component-based approach to web development. The idea behind it is to divide the user interface into independent blocks. This makes interface development easy and fast even with a complex UI, and it allows reuse of existing code without copying and pasting.&lt;/p&gt;

&lt;p&gt;Example of classes named with BEM convention below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;
&lt;span class="c"&gt;/* Block component */&lt;/span&gt;
&lt;span class="nc"&gt;.btn&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

&lt;span class="c"&gt;/* Element that depends upon the block */&lt;/span&gt; 
&lt;span class="nc"&gt;.btn__price&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

&lt;span class="c"&gt;/* Modifier that changes the style of the block */&lt;/span&gt;
&lt;span class="nc"&gt;.btn--orange&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt; 
&lt;span class="nc"&gt;.btn--big&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The block component &lt;code&gt;.btn&lt;/code&gt; is like a parent element. All of the child elements of this block should have a name like &lt;code&gt;.btn__price&lt;/code&gt;, written with two underscores after the block element. Style is applied to the block element like &lt;br&gt;
&lt;code&gt;.btn--orange&lt;/code&gt;, written with two hyphens after the block element.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why BEM ?
&lt;/h2&gt;

&lt;p&gt;BEM is easier to understand than some some of the others above but still provides us the good architecture we want and with a recognizable terminology. Some advantages include:&lt;/p&gt;

&lt;p&gt;1)If we want to make a new style of a component, we can easily see which modifiers and children already exist. &lt;/p&gt;

&lt;p&gt;2)We can quickly get an idea of which element depends on another (in the previous example we can see that .btn__price depends on .btn)&lt;/p&gt;

&lt;p&gt;3)Provides Modularity ,Reusability and Structure.&lt;/p&gt;

&lt;p&gt;4)BEM gives everyone on a project a declarative syntax that they can share so that they’re on the same page.&lt;/p&gt;

</description>
      <category>css</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Version control and Git</title>
      <dc:creator>Karthik-Prabhu-kp</dc:creator>
      <pubDate>Sun, 13 Dec 2020 19:11:34 +0000</pubDate>
      <link>https://dev.to/karthikprabhukp/version-control-and-git-55go</link>
      <guid>https://dev.to/karthikprabhukp/version-control-and-git-55go</guid>
      <description>&lt;p&gt;While we start to learn coding one term we hear a lot about is git and github and importance of version control. In this blog post i try to illustrate why version control is important in the industry.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a version control ?
&lt;/h2&gt;

&lt;p&gt;Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later. In simple terms when multiple people work on a code/file it helps you track all the changes made to that code/file and by whom it was made, it also allows you to move back to a older version in case you break the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of version control.
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Local Version Control Systems.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--car2sRHu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://git-scm.com/book/en/v2/images/local.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--car2sRHu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://git-scm.com/book/en/v2/images/local.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Local version control system maintains track of files within the local system. This approach is very common and simple. This type is also error prone which means the chances of accidentally writing to the wrong file is higher.&lt;/p&gt;

&lt;h3&gt;
  
  
  Centralized Version Control Systems.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1R89Y3HZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://gitscm.com/book/en/v2/images/centralized.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1R89Y3HZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://gitscm.com/book/en/v2/images/centralized.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this approach, all the changes in the files are tracked under the centralized server. The centralized server includes all the information of versioned files, and list of clients that check out files from that central place.This helped with collaboration among developers on different machines but its downside was the single point of failure that the centralized repository represents if it goes down during that period collaboration and saving versioned changes is not possible. &lt;/p&gt;

&lt;h3&gt;
  
  
  Distributed Version Control Systems.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7PStrJER--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://git-scm.com/book/en/v2/images/distributed.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7PStrJER--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://git-scm.com/book/en/v2/images/distributed.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this system clients don’t just check out the latest snapshot of the files; rather, they fully mirror the repository, including its full history. Thus, if any server dies, and these systems were collaborating via that server, any of the client repositories can be copied back up to the server to restore it. Every clone is really a full backup of all the data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Popular version control systems.
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1) SVN
&lt;/h3&gt;

&lt;p&gt;Apache Subversion and is a popular version control system tool. It is a centralized version control system and is system distributed and collaborated with open source license.&lt;/p&gt;

&lt;h3&gt;
  
  
  2)Mercurial
&lt;/h3&gt;

&lt;p&gt;Is free and open source distributed revision control system.This subversion control is well suited to scripting tasks with languages like Python and PHP.&lt;/p&gt;

&lt;h3&gt;
  
  
  3)Git
&lt;/h3&gt;

&lt;p&gt;Git is the distributed version control system and has an emphasis on speed and performance. It is supported by all operating systems. Git is open source software and the most widely used modern version control system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why git?
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Branch Workflow
&lt;/h4&gt;

&lt;p&gt;One of the biggest advantages of Git is its branching capabilities. Unlike centralized version control systems, Git branches are cheap and easy to merge. This facilitates the feature branch workflow popular with many Git users.&lt;/p&gt;

&lt;h4&gt;
  
  
  Pull requests
&lt;/h4&gt;

&lt;p&gt;A pull request is a way to ask another developer to merge one of your branches into their repository. This allows to keep track of changes and allows for discussions before integrating it with the rest of the codebase.&lt;/p&gt;

&lt;h4&gt;
  
  
  Community
&lt;/h4&gt;

&lt;p&gt;In many circles, Git has come to be the expected version control system for new projects. If your team is using Git, odds are you won’t have to train new hires on your workflow, because they’ll already be familiar with distributed development.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some frequently used git commands
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;git init&lt;/code&gt; - Used to create a local repository. Creates a .git subdirectory in the current working directory&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add filename&lt;/code&gt; - Adds the file to the repository.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git commit -m "commit message"&lt;/code&gt; - This will commit the changes made to the local repository.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push origin master&lt;/code&gt; - uploads local repository content in the master branch to a remote repository.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git checkout&lt;/code&gt; - Used to change between branches.&lt;/p&gt;

&lt;p&gt;Thank you for reading ! Hope you find this post useful and informative. Please leave suggestions and feedback on comments section. :)&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
