<?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: Eric Jakobsen (he/they)</title>
    <description>The latest articles on DEV Community by Eric Jakobsen (he/they) (@gentlegiantdev).</description>
    <link>https://dev.to/gentlegiantdev</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%2F865470%2F83c73175-3790-43d9-890b-2386544ca14c.jpg</url>
      <title>DEV Community: Eric Jakobsen (he/they)</title>
      <link>https://dev.to/gentlegiantdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gentlegiantdev"/>
    <language>en</language>
    <item>
      <title>“What?” - The Duck</title>
      <dc:creator>Eric Jakobsen (he/they)</dc:creator>
      <pubDate>Tue, 18 Oct 2022 00:58:04 +0000</pubDate>
      <link>https://dev.to/gentlegiantdev/what-the-duck-3dp7</link>
      <guid>https://dev.to/gentlegiantdev/what-the-duck-3dp7</guid>
      <description>&lt;p&gt;If you are new to coding there are several things you might want to purchase - a good keyboard and mouse, the most ergonomic chair within your price range, and a rubber duck. &lt;/p&gt;

&lt;p&gt;Yes, you read that last one correctly.  A rubber duck is as vital to the coding process as a workable computer. Some might argue even more so. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1OnbIUIh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k51ay306nn3h5ohqjndl.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1OnbIUIh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k51ay306nn3h5ohqjndl.gif" alt="gif of a rubber duck floating in a pool" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“How does a bathtime toy help me improve my coding?” you might ask. It is a reasonable question. &lt;/p&gt;

&lt;p&gt;You are going to talk to your rubber duck. Not only that, you are actually going to teach your rubber duck to code! As you learn new coding concepts, explain them to your duck. &lt;/p&gt;

&lt;p&gt;As you write and work through code, explain that code to your duck. What does the code do? How do the different components work together? Why did you choose this way of doing something over other options? Your duck wants to know everything!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lm8imsKV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/galqzn4s2cm6dwwj4yqm.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lm8imsKV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/galqzn4s2cm6dwwj4yqm.gif" alt='gif from "40 Year Old Virgin"' width="400" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This process of “rubber ducking” has a long history in coding. It is a tried and true method that helps us externalize our thought processes and solidify concepts. &lt;/p&gt;

&lt;p&gt;It is easy to read through an explanation of a coding concept and think we grasp it. But can you actually explain it in your own words? Is your explanation complete and still understandable? “Rubber ducking” puts these questions to a test.&lt;/p&gt;

&lt;p&gt;One of the best ways to learn is to teach. Consciously and consistently building that process into your coding journey will help you succeed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UmCp1WXA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fd2qigr3u5ecj5o0pu70.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UmCp1WXA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fd2qigr3u5ecj5o0pu70.gif" alt="Gif of Boyle from Brooklyn99" width="356" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“Rubber ducking” is actually more helpful in learning than teaching another person. Why? Your rubber duck is always there! You don’t have to wait for a set time to explain the concepts you are learning but can do it while you learn.&lt;/p&gt;

&lt;p&gt;I am a big of &lt;a href="https://barbaraoakley.com/"&gt;Barbara Oakley&lt;/a&gt; and her course, &lt;a href="https://www.coursera.org/learn/learning-how-to-learn"&gt;“Learning How to Learn”&lt;/a&gt;. In it she extolls the virtues of active recall - the act of retrieving information from your memory to deliberately strengthen the neural pathways to it. &lt;/p&gt;

&lt;p&gt;In other words, you can strengthen your long term grasp of material by stopping periodically as you learn to remember what you learned. At the end of each page, what main points were covered in the paragraphs? At the end of the chapter, what were the main ideas the author was trying to get across?&lt;/p&gt;

&lt;p&gt;Can you recall them? And can you explain them in your own words so your rubber duck can understand?&lt;/p&gt;

&lt;p&gt;Rubber ducking also prepares you to excel at technical interviews. Interviewers don’t just want to watch you solve the coding challenges they present. They want to hear your thought process and see how you engage with others when solving a problem. All your “rubber ducking” is practice for doing exactly that! &lt;/p&gt;

&lt;p&gt;These interviews are meant to assess how you will do on the job, so unsurprisingly “rubber ducking” will also help you prepare for that. All of us who have worked on teams can attest how nice it is to work with other devs who can communicate well. I will gladly take someone who can communicate processes and their perspective clearly over the most skilled coder who cannot. I promise I am not alone in that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eXRwLJQU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gbhf4ilz02cr8gm5y7xc.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eXRwLJQU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gbhf4ilz02cr8gm5y7xc.gif" alt='gif of Spongebob: "Communication"' width="220" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  “Does it have to be a duck?”
&lt;/h2&gt;

&lt;p&gt;No, not at all. You are welcome to use a rubber duck for tradition’s sake but any object will do. I happen to use Groot who is an expert software engineer by now:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3boBfA3_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/stylaqku9sor75ru1t81.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3boBfA3_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/stylaqku9sor75ru1t81.jpg" alt='My "duck," Groot' width="880" height="975"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I use Groot because he has those big kind eyes that just scream “I support you and am listening.” That is the energy I need, especially when I am stuck on a frustrating problem or concept. I recommend choosing a “rubber duck” you especially enjoy since you will be spending lots of time together.&lt;/p&gt;

&lt;p&gt;I hope this gives you some insight into the world of “rubber ducking.” Please share your rubber ducks in the comments!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ph_IIokx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wrarvjiynbki4x665gk4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ph_IIokx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wrarvjiynbki4x665gk4.jpg" alt="Image description" width="880" height="864"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Final fun fact - &lt;a href="https://twitter.com/rfornal"&gt;Bob Fornal&lt;/a&gt; actually sent me his rubber duck, BatDuck, for a visit here in Tucson. BatDuck is still traveling around the world from one coder to another.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to keep your secrets off GitHub</title>
      <dc:creator>Eric Jakobsen (he/they)</dc:creator>
      <pubDate>Mon, 17 Oct 2022 02:01:19 +0000</pubDate>
      <link>https://dev.to/gentlegiantdev/how-to-keep-your-secrets-off-github-2109</link>
      <guid>https://dev.to/gentlegiantdev/how-to-keep-your-secrets-off-github-2109</guid>
      <description>&lt;p&gt;GitHub makes a developer’s life so much easier - you can use it to collaborate, track changes, and backup your files securely with ease. If you are not careful you can also expose pieces of your code that could put all your work at risk.&lt;/p&gt;

&lt;p&gt;For example, if you are using MongoDB as your database you will need to store your MongoDB access string in your code. If you push your code to GitHub with that access string visible any person who sees your project can then access your database and monkey with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  “A better way”
&lt;/h2&gt;

&lt;p&gt;The first step to keep your secrets safe is to use environment variables. Node supports these out of the box through the “env" object that is itself a property of the “process” global object. Environment variables are typically written in all caps. So an example would be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DB_STRING = mongodb+srv://username:password@example.1iq6k8.mongodb.net/?retryWrites=true&amp;amp;w=majority
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allows us to include our secret information throughout our code without actually showing it.&lt;/p&gt;

&lt;h2&gt;
  
  
  “But the variable has to be declared somewhere, right?”
&lt;/h2&gt;

&lt;p&gt;Correct, dear reader. The environment variables do have to be declared somewhere. We will do that in a special folder called “.env”. This folder will eventually load all environmental variables within it automatically into the “process.env” object. An npm package called “dotenv” drives that process so we need to install it. &lt;/p&gt;

&lt;p&gt;You need to already have Node.js and npm installed for this to work. You can find downloads and instructions for those &lt;a href="https://docs.npmjs.com/downloading-and-installing-node-js-and-npm"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once you have Node and npm installed, simply use the following terminal command to install “dotenv”:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i dotenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then require and configure “dotenv” in your app as such:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require(‘dotenv’).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once this is installed, go into your file structure and create a file called “.env” either at the top level or in your config folder (in which case you would need to set the appropriate path for its location in your code: "require(‘dotenv’).config()"). Open this file and plop in your environment variables. &lt;/p&gt;

&lt;p&gt;Here we have the DB_STRING from earlier as well as the PORT our server is running on locally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DB_STRING = mongodb+srv://username:password@example.1iq6k8.mongodb.net/?retryWrites=true&amp;amp;w=majority

PORT = 2121
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You may notice there are no quotation marks - "dotenv" automatically takes care of those.&lt;/p&gt;

&lt;h2&gt;
  
  
  “One last step”
&lt;/h2&gt;

&lt;p&gt;There is only one final step: set up a “.gitignore” folder. Like the name suggests, GitHub will ignore anything referenced in this folder and not upload it to your repo.&lt;/p&gt;

&lt;p&gt;Go back to into your file structure and at the top level create a file called “.gitignore”. Then add in your “.env” folder like such:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also add "node_modules" and any other large packages that can be reinstalled locally. That saves the time it takes to push your code to GitHub as well as your storage there.&lt;/p&gt;

&lt;h2&gt;
  
  
  “That’s it, folks!”
&lt;/h2&gt;

&lt;p&gt;Thanks for spending a few minutes with me exploring this topic. I hope it was helpful and you now feel sure of how to guard your secrets. Feel free to ask any questions you have in the comments and I will do my best to address them!&lt;/p&gt;

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