<?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: Josey Kinnaman</title>
    <description>The latest articles on DEV Community by Josey Kinnaman (@joseykinnaman).</description>
    <link>https://dev.to/joseykinnaman</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%2F541100%2Fbb83dc2a-98b9-48b7-97ea-87781fff41a2.jpeg</url>
      <title>DEV Community: Josey Kinnaman</title>
      <link>https://dev.to/joseykinnaman</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joseykinnaman"/>
    <language>en</language>
    <item>
      <title>The Art of Debugging </title>
      <dc:creator>Josey Kinnaman</dc:creator>
      <pubDate>Tue, 15 Dec 2020 19:56:46 +0000</pubDate>
      <link>https://dev.to/joseykinnaman/the-art-of-debugging-2ooe</link>
      <guid>https://dev.to/joseykinnaman/the-art-of-debugging-2ooe</guid>
      <description>&lt;p&gt;I will start out by saying, I am a junior developer, so 85% of the time... I am the bug. I have however developed some tips and tricks along the way that have helped pinpointing my bugs as well as in writing cleaner and dryer code. &lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to Debugging
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Start by writing clearly planned and tested code:&lt;/strong&gt;&lt;br&gt;
This may seem like a no brainer but the process of "sharpening the axe before cutting down the tree" really, really helps in the debugging process. Before I code at all or even write a README.md I start by asking myself 3 questions and writing them out in Evernote (for searchability later on).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What am I trying to code and/or what is the bug that I am trying to solve? What do I already know about said code?&lt;/li&gt;
&lt;li&gt;What questions do I have/things do I not know?&lt;/li&gt;
&lt;li&gt;Answers to those questions as I find them.
I then begin to make my README.md, user stories, and diagrams (if not already existing). When I have a pretty clearly documented plan I begin to write or modify tests. Often once I solve or find a bug, I will come back and modify or update tests and documentation.&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Check for esLint errors or highlighted/non highlighted code in VS Code.&lt;/strong&gt; It is always worth taking the time to set up esLint for a project. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check variables and spelling check syntax.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Dev Tools:&lt;/strong&gt; I really love Chrome Dev tools. I think it is worth it though to test code in multiple browsers. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check the console for errors: is the error obvious?&lt;/li&gt;
&lt;li&gt;Reproduce the error if semantic (enter data into a form etc.) &lt;/li&gt;
&lt;li&gt;Try

&lt;code&gt;console.log()&lt;/code&gt;

,

&lt;code&gt;console.error()&lt;/code&gt;

,

&lt;code&gt;print&lt;/code&gt;

. I feel like these are very base level debugging tools and are sometimes more trouble than they are worth after the fact. I find these tools more helpful while writing initial code. &lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Comment out code&lt;/em&gt;&lt;/strong&gt; in and error message to help locate an error using comment tags. Once you pinpoint the error look at syntax, spelling, and functionality. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sources tab -&amp;gt; Event listener breakpoints -&amp;gt; step into , step over,  step out of... etc. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pause code at other break points &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If trouble shooting an API request... checkout the Network tab to see the amount of requests be sent and what is being received. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are also numerous different language specific debugging tools that come in very handy during coding and debugging but these steps are a great start. What tips do you use and when do you crack and ask for another set of eyes? Thanks for reading!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>testing</category>
      <category>bugs</category>
    </item>
  </channel>
</rss>
