<?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: austinckohler</title>
    <description>The latest articles on DEV Community by austinckohler (@austinckohler).</description>
    <link>https://dev.to/austinckohler</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%2F422015%2F8ce21a73-a6f9-4644-ac66-ffead8e70dcb.jpeg</url>
      <title>DEV Community: austinckohler</title>
      <link>https://dev.to/austinckohler</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/austinckohler"/>
    <language>en</language>
    <item>
      <title>useState  hook with Functional Components</title>
      <dc:creator>austinckohler</dc:creator>
      <pubDate>Thu, 16 Jul 2020 02:48:20 +0000</pubDate>
      <link>https://dev.to/austinckohler/usestate-hook-with-functional-components-2837</link>
      <guid>https://dev.to/austinckohler/usestate-hook-with-functional-components-2837</guid>
      <description>&lt;h1&gt;
  
  
  What is useState?
&lt;/h1&gt;

&lt;p&gt;Potentially the most important React hook. It is important because it allows you to have state variables in functional components. According to the official documentation on &lt;a href="https://reactjs.org/docs/hooks-reference.html#usestate"&gt;React.org&lt;/a&gt;, &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Prior to the addition of hooks we would need to write a class to store state and make a dynamic component. &lt;/p&gt;

&lt;h2&gt;
  
  
  How do you implement its functionality?
&lt;/h2&gt;

&lt;p&gt;First, we must import the hook from react like so:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IllMBi5t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vrtf1u2qcx27rwgi0kma.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IllMBi5t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vrtf1u2qcx27rwgi0kma.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Before diving in it is important to note:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Hooks can only be used inside functional components&lt;/li&gt;
&lt;li&gt;Hooks must execute in exact order in every component render. For example,
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;if (true) { &lt;br&gt;
useState() &lt;br&gt;
} &lt;br&gt;
useState()&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;will give you and error:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;React hook "useState" is called conditionally&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In other words they can't be placed inside functions, conditionals, loops, etc. and must be at the top level.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you use it?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fi3QztUn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bi2g2qs4vmtyta3oe0a5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fi3QztUn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bi2g2qs4vmtyta3oe0a5.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Import useState. &lt;/li&gt;
&lt;li&gt;Initialize useState. The first argument in useState(initialState) is default state. For example, I want a user to click a grey button and the background color of an icon turn pink. default state is false. In other words, the user has not clicked the button; therefore, its initial state is false, the button hasn't been clicked and the background of the icon is grey.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useState } from 'react';

function iconColor() {
  const [color, setColor] = useState(false);

}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;When the function, useState(false) is invoked, it will return an array with two values. Our first value is state and our second value is a function that allows us to update the current state. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Update state. Using the second value, again a function, we will update state.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function changeColor() {
const [color, setColor] = useState(false);

  const iconGrey = () =&amp;gt; setColor(false);
  const iconPink = () =&amp;gt; setColor(true);

  return (
    &amp;lt;&amp;gt;
      &amp;lt;div className={color ? "icon-pink" : "icon-grey"} /&amp;gt;
      &amp;lt;button onClick={iconPink}&amp;gt;On&amp;lt;/button&amp;gt;
      &amp;lt;button onClick={iconGrey}&amp;gt;Off&amp;lt;/button&amp;gt;
    &amp;lt;/&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;for this example, "icon-pink" and "icon-grey" are icons that have preset colors.&lt;/p&gt;

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

&lt;p&gt;This is the absolute basic use case of useState. If you would like to learn more about different use cases I would recommend checking out React.org's official documentation. &lt;/p&gt;

</description>
      <category>react</category>
      <category>functional</category>
    </item>
    <item>
      <title>Beginners guide to writing a compelling README.md</title>
      <dc:creator>austinckohler</dc:creator>
      <pubDate>Wed, 15 Jul 2020 15:17:43 +0000</pubDate>
      <link>https://dev.to/austinckohler/beginners-guide-to-writing-a-compelling-readme-md-45n8</link>
      <guid>https://dev.to/austinckohler/beginners-guide-to-writing-a-compelling-readme-md-45n8</guid>
      <description>&lt;h2&gt;
  
  
  What is a README.md?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LncrjWoY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hn38newsmf0c1mk5uqwx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LncrjWoY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hn38newsmf0c1mk5uqwx.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;README.md is the first thing someone reviewing your project will see, so it really needs to captivate the viewer.&lt;/p&gt;

&lt;p&gt;What's up with the .md? It means markdown. It is a markup language for text.&lt;/p&gt;

&lt;p&gt;Your README should explain how your project could be used and how to use it. Think of it as the front page of the project and a place to get started.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do I need a README?
&lt;/h3&gt;

&lt;p&gt;short answer, &lt;strong&gt;YES&lt;/strong&gt;. Make a short README on your first commit. &lt;/p&gt;

&lt;h4&gt;
  
  
  Why?
&lt;/h4&gt;

&lt;p&gt;Good question. There are several reasons why you &lt;strong&gt;NEED&lt;/strong&gt; a README:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;For reference during your project to remind yourself of the goals you set.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You know your project is great, so make it easy to understand why it is so great. No one likes trying to understand a project by reading poor documentation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To stand out and entice people to learn more about your amazing project.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What should it include?
&lt;/h2&gt;

&lt;p&gt;At a minimum, your README should include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A brief description of your project, what it does, and how to use it&lt;/li&gt;
&lt;li&gt;A demo - screen recorded and uploaded to YouTube&lt;/li&gt;
&lt;li&gt;Screenshots of your project&lt;/li&gt;
&lt;li&gt;Technologies used and the requirements&lt;/li&gt;
&lt;li&gt;Acknowledgements&lt;/li&gt;
&lt;li&gt;The developer and contact information&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Resources:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://guides.github.com/pdfs/markdown-cheatsheet-online.pdf"&gt;GitHub Markdown Cheatsheet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://guides.github.com/features/mastering-markdown/"&gt;Mastering Markdown&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.makeareadme.com/"&gt;Make a README&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;When job searching, employers will review your top projects and having a well written README.md could help land that dream job. Also spending an extra 10-20 minutes writing up a kickass README.md could make a huge impact on how many people take the time to look at your project. Many developers will spend a lot of time adjusting the background image or fixing the letter spacing but won't make a README.md for their project. This can discourage potential employers and connections from looking further into your work. Don't be that person. Make the README.&lt;/p&gt;

</description>
      <category>beginners</category>
    </item>
    <item>
      <title>Hello World: What I wish I knew at the beginning of my programming journey. </title>
      <dc:creator>austinckohler</dc:creator>
      <pubDate>Wed, 15 Jul 2020 04:10:26 +0000</pubDate>
      <link>https://dev.to/austinckohler/hello-world-what-i-knew-at-the-beginning-of-my-programming-journey-2ngc</link>
      <guid>https://dev.to/austinckohler/hello-world-what-i-knew-at-the-beginning-of-my-programming-journey-2ngc</guid>
      <description>&lt;h1&gt;
  
  
  Hello World:
&lt;/h1&gt;

&lt;h4&gt;
  
  
  Where do the bootcampers get a drink after a full day of coding? You guessed it, foo bar!
&lt;/h4&gt;

&lt;p&gt;On a more serious note, I began my programming journey a measly four months ago. Other than learning the very basics about programming on sites like &lt;a href="https://www.codecademy.com/"&gt;codecademy&lt;/a&gt; and &lt;a href="https://www.khanacademy.org/"&gt;Khan Academy&lt;/a&gt; I knew little to nothing about the culture. &lt;/p&gt;

&lt;p&gt;I attended a programming bootcamp and learned a lot throughout the process but here are a few things I wish I knew when I started the bootcamp: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;You are not limited to the resources the bootcamp has to offer.&lt;/strong&gt; This seems like a given, right? It might be, and I'm sure my instructors probably told us this; however, I probably could've heard that a few more times. It took me twelve weeks to realize some of the best introductions to a new technology are simply the official documentation for the technology, scouring &lt;a href="https://github.com/"&gt;GitHub&lt;/a&gt; for any juicy documentation, or just going to the handy dandy youtube. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Star &lt;a href="https://github.com/sindresorhus/awesome"&gt;sindresorhus/awesome&lt;/a&gt; on GitHub&lt;/strong&gt;. Don't forget to thank him for all the effort he put into this repository. Before I start learning any new technology I go the above mentioned repository and drink all the information from the firehose. There is not much more to say here, but this was something I wish I learned about before I started programming. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Take breaks, and take them often.&lt;/strong&gt; When I first started programming, I would catch myself typing away till two in the morning. I would get stuck with error message after error message searching &lt;a href="https://stackoverflow.com/"&gt;Stack Overflow&lt;/a&gt; for answers I'd never find. Eventually I would tire out, not solving the issue at hand, wake up in the morning look at the code for 5 minutes or less and solve the issue. This happened countless times, and admittedly still does, but I am starting to understand the importance of taking breaks. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Attend Meetups.&lt;/strong&gt; Dive into the community, learn to embrace the uncomfortable, and make friends while you do it. When you first start programming there is a lot to take in and it may be hard to jump into meetups not sure of what to say or what is going on. I wish I would've known that it's perfectly fine to show up to a meeting, listen, and not be sure of what is going on. Eventually you'll be participating and making connections that may lead to future job opportunities. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Make an effort to help others to solidify your knowledge.&lt;/strong&gt; Moving information from short term memory to long term memory can be achieved by teaching a recently acquired skill to someone else after learning it. I wish I would've known how effective this can be when starting to program. Talking your code out like you eventually will in an interview will give anyone a leg up. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;During my process of becoming a software engineer there are many other things I wish I would've known but these 5 tips would have had the greatest impact on my learning experience.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
