<?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: Logan Johnson</title>
    <description>The latest articles on DEV Community by Logan Johnson (@findlogan).</description>
    <link>https://dev.to/findlogan</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%2F338512%2F27ca0370-9b10-4bf2-9ceb-4fee049bbac4.png</url>
      <title>DEV Community: Logan Johnson</title>
      <link>https://dev.to/findlogan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/findlogan"/>
    <language>en</language>
    <item>
      <title>Naming Conventions: Fix It.</title>
      <dc:creator>Logan Johnson</dc:creator>
      <pubDate>Thu, 20 Feb 2020 14:36:02 +0000</pubDate>
      <link>https://dev.to/findlogan/naming-conventions-fix-it-gfo</link>
      <guid>https://dev.to/findlogan/naming-conventions-fix-it-gfo</guid>
      <description>&lt;h2&gt;Intro&lt;/h2&gt;

&lt;p&gt;Most newer people don't usually think of this often, and for that reason this post is dedicated to newer developers. Even if you are more seasoned, I hope that you are able to take some sort of value from this post, as I have seen some of this around my classes.&lt;/p&gt;

&lt;p&gt;I have pulled a lot of this from my journal on my website for your enjoyment here because I believe more people should see it and be helped. Enjoy!&lt;br&gt;
&lt;/p&gt;


&lt;p&gt;There are two things that come to mind when you open your own code after a long period of time.. or that even of another developer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;WOW! That is so cool!&lt;/li&gt;
&lt;li&gt;Oh my goodness, who wrote this?!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We all would like to believe that our code looks like #1 -- but the honest truth if we can be honest with ourselves is: sometimes we'll look at our own stuff and thing about scenario #2. &lt;/p&gt;

&lt;p&gt;I've composed some tips from multiple sources and people as well as myself, and I hope you find this useful! As far as crediting goes, it was people I met on platforms like discord and a few interpreted things off multiple searches on the internet.&lt;/p&gt;

&lt;h3&gt;Avoid abbreviation for things that are not commonly known&lt;/h3&gt;

&lt;p&gt;Things like "nav" or "hero" is okay because you or someone else nine times out of ten would know what this means.&lt;/p&gt;

&lt;p&gt;Things like "blk" or "herr" is not okay because you or someone else will almost never know what this means unless they contributed and can remember what it was supposed to.&lt;/p&gt;

&lt;h3&gt;Make re-usable classes and names&lt;/h3&gt;

&lt;p&gt;When you type something out, write DRY (Don't Repeat Yourself) code. Make the classes and names re-usable, for example : "flex" could be used to throw flex display on something, but "flext-and-to-the-right" would not be good because now you're being super specific what that CSS class will do. Now if you need something on the left a few times, this will not serve you sell, and you'll end up making a longer** CSS file.&lt;/p&gt;

&lt;h3&gt;Try to avoid more than two words for a given name&lt;/h3&gt;

&lt;p&gt;Here's an example I found off a website in the past :&lt;/p&gt;

&lt;p&gt;.button {&lt;br&gt;
/* OK */&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;.dropdown-button {&lt;br&gt;
/* still OK */&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;.dropdown-button-part-one {&lt;br&gt;
/* Hmm, still ok, but will be unredable when adding children, for ex : */&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;.dropdown-button-part-one__button-admin {&lt;br&gt;
/* Yikes !!! */&lt;br&gt;
}&lt;/p&gt;

&lt;h3&gt;Make names reflect functionality&lt;/h3&gt;

&lt;p&gt;If your class sets the display to flex, you shouldn't name it: "super-awesome-block-element-thing" or even "hero-banner-box".. you should name it something related to what it does. This applies to all programming languages, and in my opinion, you should always be thinking of this when naming things.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;These are just my opinion and suggestions to help you out long term, you do NOT have to use them, but take it for what its worth if it's any good to you.&lt;/p&gt;

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