<?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: Sergio B</title>
    <description>The latest articles on DEV Community by Sergio B (@sberdup).</description>
    <link>https://dev.to/sberdup</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%2F842740%2Fb614284e-84df-49c6-8e56-6aee2e8fc54e.png</url>
      <title>DEV Community: Sergio B</title>
      <link>https://dev.to/sberdup</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sberdup"/>
    <language>en</language>
    <item>
      <title>On the Virtues of RegExp in JS</title>
      <dc:creator>Sergio B</dc:creator>
      <pubDate>Mon, 15 Aug 2022 03:01:06 +0000</pubDate>
      <link>https://dev.to/sberdup/on-the-virtues-of-regexp-in-js-31gg</link>
      <guid>https://dev.to/sberdup/on-the-virtues-of-regexp-in-js-31gg</guid>
      <description>&lt;p&gt;When it comes to regex, I have a disproportionate amount of love for the lil' fella. Much like a tire iron clanking around in the trunk of your car, or a corkscrew in the back of the silverware drawer, it only truly shines when you find yourself desperately &lt;em&gt;needing&lt;/em&gt; it. I recently found myself looking to implement a search function in a React app and would like to share how &lt;strong&gt;you&lt;/strong&gt; can make one that works as snappy, effectively, and easily as mine.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Old Way
&lt;/h2&gt;

&lt;p&gt;A while ago I had an assignment that featured a search bar that utilized the classic .startsWith() method to determine which entries to display on a page.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KvawCO4b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vourx3n2s1m827t1pwba.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KvawCO4b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vourx3n2s1m827t1pwba.png" alt="startsWith search" width="426" height="174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the background, it utilized state that was derived from a user-input search field. Using this, it compared the item description with a lowercase version of the user input (for uniformity) and then the aforementioned startsWith() to get back entries beginning with the supplied search. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2G85sytC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dansax56u16v4iq1tadl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2G85sytC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dansax56u16v4iq1tadl.png" alt="sample search" width="660" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And yeah sure, it works, but what if the item &lt;em&gt;doesn't&lt;/em&gt; startsWith free? What if the people posting on Gregory's list weren't at 100% that day and they wrote &lt;em&gt;dfree braun 3735 elemtric tothbrush&lt;/em&gt; ? Or what if the word free &lt;strong&gt;wasn't&lt;/strong&gt; the first word? What then?&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q1THwy5U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fyfq517nk6i8pokjcjvg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q1THwy5U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fyfq517nk6i8pokjcjvg.png" alt="a failed search" width="654" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I could've &lt;em&gt;sworn&lt;/em&gt; I saw a guy selling these.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The RegEx Way
&lt;/h2&gt;

&lt;p&gt;Long story short, there's a way to make a better and cleaner search method, if you're willing to learn a &lt;em&gt;little&lt;/em&gt; regex. Here's an altered version using an implementation I discovered while working on a search field for a project of my own.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xvTViMwm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hb0jef5c1qsyoaigrcvs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xvTViMwm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hb0jef5c1qsyoaigrcvs.png" alt="new code with regex" width="458" height="115"&gt;&lt;/a&gt;&lt;br&gt;
And the result.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Fk20xpRp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vlcw7j255uuos0qbs329.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Fk20xpRp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vlcw7j255uuos0qbs329.png" alt="new search" width="633" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;There it is!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As you'll notice, this doesn't start with "Braun" at all. As a matter of fact... &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aMawcQtx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x0sop6fe81bmnbmeo9az.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aMawcQtx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x0sop6fe81bmnbmeo9az.png" alt="all free stuff" width="628" height="612"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some of this stuff &lt;em&gt;ended&lt;/em&gt; with free. So what gives? Is regex magic?&lt;/p&gt;

&lt;h2&gt;
  
  
  Yes.
&lt;/h2&gt;

&lt;p&gt;The .search() method in JavaScript will search through a string using a regular expression (or a string that gets converted to a regular expression) and return the index of where it finds a match, or -1 if there's no match. Hence comparing the final return to see if it is positive.&lt;/p&gt;

&lt;p&gt;The RegExp object in JS allows you to create a new regular expression based on a string you hand it, alongside a second argument in the form of a string of optional flags. Here, I used interpolation to set the string the regular expression will look for alongside the special &lt;em&gt;i&lt;/em&gt; flag to designate case-insensitive matching. This results in a regex equivalent of /{user search}/i.&lt;/p&gt;

&lt;p&gt;So why not just interpolate directly inside of the .search() and save the hassle of messing around with a new Object?&lt;/p&gt;

&lt;p&gt;Because &lt;strong&gt;I DO NOT&lt;/strong&gt; recommend mucking about with back and forward slashes to make interpolation work inside a standard regex. Seriously, regex takes things very literally and $ , { , &lt;em&gt;and&lt;/em&gt; } are all reserved characters.&lt;/p&gt;

&lt;h2&gt;
  
  
  /tl;dr/i
&lt;/h2&gt;

&lt;p&gt;Regular Expressions are cool as heck and have lots of potential applications with searches being just the tip of the iceberg. For more information, I highly recommend &lt;a href="https://regexone.com/"&gt;RegexOne&lt;/a&gt;, the place I learned everything I know about RegEx. &lt;/p&gt;

</description>
      <category>regex</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>Intro to useRef hook</title>
      <dc:creator>Sergio B</dc:creator>
      <pubDate>Mon, 04 Jul 2022 04:22:45 +0000</pubDate>
      <link>https://dev.to/sberdup/intro-to-useref-hook-1aj7</link>
      <guid>https://dev.to/sberdup/intro-to-useref-hook-1aj7</guid>
      <description>&lt;p&gt;In the course of working on a project for Flatiron School, I stumbled upon a use case for a React hook that I had yet to encounter. It was actually in compiling my code that my console suggested the useRef hook and I'd like to show how it solved my problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  A &amp;lt; div /&amp;gt; in Motion
&lt;/h2&gt;

&lt;p&gt;The central idea behind my project involved getting a div element to "bounce" off a boundary and come back. I initially used a combination of useState and useEffect to achieve this within the component I intended to bounce.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EiQjgata--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ywnd481ev437rgaxgl9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EiQjgata--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ywnd481ev437rgaxgl9.png" alt="My stateful code" width="880" height="506"&gt;&lt;/a&gt;&lt;br&gt;
Because I needed to actually re-render the component to reflect where its calculation had moved it to, I needed to nest a setInterval() inside a useEffect hook. The reason I am returning a cleanup function here to clear my clock interval is because without it, a new setInterval would be created on every state change until they all piled up and updated the component's position wayyy too many times.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rVetyAp5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/75o0o1n96m85vy9mt9b3.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rVetyAp5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/75o0o1n96m85vy9mt9b3.gif" alt="The Bouncer in action" width="326" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The bouncer at the start of its journey.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Everything seemed fine with this approach until I got to a point where multiple state changes need to happen synchronously. Here's what happens when this code reaches the boundary condition at 93 viewport width units: &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--R6s13Ho5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p5alf3t27hy1kxdmvktr.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R6s13Ho5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p5alf3t27hy1kxdmvktr.gif" alt="My bouncer running into a wall again and again." width="326" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As you can see, it's just running into the wall over and over &lt;em&gt;(much like myself trying to fix this problem)&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After console.logging extensively and reviewing state, I localized the problem to my state variable for the current direction of my component (xSpeed) not being able to change fast enough to accurately change the value of my xPosition state. So when the variables become unsynced due to not having updated together as they should've, xSpeed is constantly flipped due to xPosition being on the &lt;strong&gt;right&lt;/strong&gt; side of the boundary, a place I hadn't considered possible to reach.&lt;/p&gt;

&lt;p&gt;Another thing about the way I implemented my bouncing div is that state was &lt;strong&gt;constantly&lt;/strong&gt; updating, which is a lot of re-rendering. In attempting to fix this without useRef, I managed to cause my first infinite re-render loop. I could've reworked the way I assigned the value for state or just made one state calculable from the other by perhaps refactoring my whole code for this, but the error I got from running this on a development server actually suggested the useRef hook as a fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  When is a State Not a State?
&lt;/h2&gt;

&lt;p&gt;So what does useRef do to remedy this? Well, to put it in an overly simplistic way, it offers a way to make a state variable that can be updated &lt;em&gt;without&lt;/em&gt; triggering a re-render. Here's the changed section of my code with the useRef hook instead of another state.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HapE2ND5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xwypw8ytndnukop2aj1e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HapE2ND5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xwypw8ytndnukop2aj1e.png" alt="Fixed code." width="545" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note how I am still re-rendering through useEffect with the &lt;em&gt;position&lt;/em&gt; of my bouncing div.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;useRef creates an object with a special property under the object's .current key. This key has a value that you can set to whatever you like, just like useState, but this property is readable just like a variable you're used to in JavaScript. In my implementation of it, it means that when I update this div's speed to -1, I am immediately able to access xSpeed.current's new value and subtract 1 from my xPosition state. This fixes my logic and reduces the number of re-renders needed.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vEIZwVXE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/61hqs3mnb8g3i7yehivk.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vEIZwVXE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/61hqs3mnb8g3i7yehivk.gif" alt="The bouncer returns!" width="326" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;And now we get a proper bounce!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;So, if you ever need to have a variable stored in a component like a state, but you &lt;strong&gt;don't&lt;/strong&gt; want to re-render every time you re-assign the value of that variable, consider useRef. If you ever need to reassign state and aren't patient enough to wait for a re-render before accessing that new state for another statement, &lt;strong&gt;definitely&lt;/strong&gt; consider useRef.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>react</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Array and Object Manipulation + DOM differences</title>
      <dc:creator>Sergio B</dc:creator>
      <pubDate>Thu, 19 May 2022 01:39:53 +0000</pubDate>
      <link>https://dev.to/sberdup/array-and-object-manipulation-dom-differences-2ijf</link>
      <guid>https://dev.to/sberdup/array-and-object-manipulation-dom-differences-2ijf</guid>
      <description>&lt;p&gt;For too long &lt;em&gt;(about a few weeks)&lt;/em&gt;, I have second guessed myself every time I've started writing a For... loop. Here, I will show you how to know which one you should use for the task at hand, what can happen when you choose the wrong one, and how this extends to DOM elements. &lt;/p&gt;

&lt;h2&gt;
  
  
  For... of
&lt;/h2&gt;

&lt;p&gt;When handling arrays of data, using a For...of loop is a great option.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9gqkct6enhil1anyo6zb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9gqkct6enhil1anyo6zb.png" alt="array logging"&gt;&lt;/a&gt;&lt;br&gt;
Every time the loop is entered here, a new entry from the array is loaded into the value of i. The first console.log here will show i as being equal to the value of array[0], or 'apple'. The second as 'banana' and so on. Note that i is &lt;em&gt;not&lt;/em&gt; equal to the &lt;em&gt;index&lt;/em&gt; value of the item.&lt;/p&gt;
&lt;h2&gt;
  
  
  For... in
&lt;/h2&gt;

&lt;p&gt;Now for objects, a For...in loop is what you want to use. I like to imagine that I'm looking &lt;strong&gt;in&lt;/strong&gt;side of the object to see all the keys and values. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcs18qwjn7dn9rxh4rvuo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcs18qwjn7dn9rxh4rvuo.png" alt="object logging"&gt;&lt;/a&gt;&lt;br&gt;
For this type of loop, every time i is reassigned, it gets a new &lt;em&gt;key&lt;/em&gt;. Now, let's change our objectLogger function to see if we can view the values instead.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxvmvwqav80r1q7pclixq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxvmvwqav80r1q7pclixq.png" alt="object value logging"&gt;&lt;/a&gt;&lt;br&gt;
By choosing to log object[i] instead of i, we can see every &lt;em&gt;value&lt;/em&gt; in our object. So by using this type of loop, we can gain complete insight into every key:value pair in our object. An important thing to keep in mind when accessing objects like this is to NOT use dot notation and instead use the &lt;em&gt;computed member access operator&lt;/em&gt;, aka &lt;strong&gt;brackets&lt;/strong&gt;, for getting object properties. In this function, attempting to console.log object &lt;strong&gt;. i&lt;/strong&gt; results in an undefined error as JavaScript tries to look through the object for a key literally called i.&lt;/p&gt;
&lt;h2&gt;
  
  
  What happens if we forget?
&lt;/h2&gt;

&lt;p&gt;In the case of trying to treat an object as if it were an array, disastrous consequences will immediately occur and your IDE will make that clear as soon as you try to run the code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;arrayLogger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;animalObject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;// will return the following:&lt;/span&gt;
&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="nx"&gt;Uncaught&lt;/span&gt; &lt;span class="nx"&gt;TypeError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;array&lt;/span&gt; &lt;span class="nx"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;not&lt;/span&gt; &lt;span class="nx"&gt;iterable&lt;/span&gt;
    &lt;span class="nx"&gt;at&lt;/span&gt; &lt;span class="nf"&gt;arrayLogger &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;at&lt;/span&gt; &lt;span class="nx"&gt;HTMLDocument&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;anonymous&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, in the case of treating an array as an object, something interesting happens.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;objectLogger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruitArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;//=&amp;gt; apple, banana, cantaloupe&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You are actually able to treat an array as an object in JavaScript, because it &lt;strong&gt;is&lt;/strong&gt;  a subtype of object.&lt;/p&gt;

&lt;p&gt;Check it out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;fruitArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;//=&amp;gt; object&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;animalObject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;//=&amp;gt; object&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;&lt;strong&gt;Interesting.&lt;/strong&gt;&lt;/em&gt; This is also why it is also a terrible idea to use the &lt;em&gt;typeof&lt;/em&gt; operator to distinguish between an array and an object.&lt;/p&gt;

&lt;h2&gt;
  
  
  DOM Elements and Notes on Handling Them
&lt;/h2&gt;

&lt;p&gt;After some experimentation on a beautiful HTML page, I've been able to get a better handle on what exactly happens when putting together a collection of HTML/Node elements.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftnrffkl34ksqy1mxlm9i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftnrffkl34ksqy1mxlm9i.png" alt="html source code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The relevant portion of my test HTML file.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyrcy2p1lawyqi2306sef.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyrcy2p1lawyqi2306sef.png" alt="html + css output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I'll spare you the eye-searing entirety of the output.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So let's see what happens when we gather the elements up in HTML collection form.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;divItems&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementsByTagName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;div&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;divItems&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;//=&amp;gt; HTMLCollection(7) [div, div, div, div, div, div, div]&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;divItems&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// will output :&lt;/span&gt;
 &lt;span class="c1"&gt;//   &amp;lt;div&amp;gt;Hey&amp;lt;/div&amp;gt;&lt;/span&gt;
 &lt;span class="c1"&gt;//   &amp;lt;div&amp;gt;it's&amp;lt;/div&amp;gt;&lt;/span&gt;
 &lt;span class="c1"&gt;//   &amp;lt;div&amp;gt;a&amp;lt;/div&amp;gt;&lt;/span&gt;
 &lt;span class="c1"&gt;//   &amp;lt;div&amp;gt;whole&amp;lt;/div&amp;gt;&lt;/span&gt;
 &lt;span class="c1"&gt;//   &amp;lt;div&amp;gt;bunch&amp;lt;/div&amp;gt;&lt;/span&gt;
 &lt;span class="c1"&gt;//   &amp;lt;div&amp;gt;of&amp;lt;/div&amp;gt;&lt;/span&gt;
 &lt;span class="c1"&gt;//   &amp;lt;div&amp;gt;divs!&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Okay, so this HTML collection is a type of array. But what if we handle it like an object?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;divItems&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// will output the following (numbers on one line for readability)&lt;/span&gt;
&lt;span class="c1"&gt;// 0, 1, 2, 3, 4, 5, 6&lt;/span&gt;
&lt;span class="c1"&gt;// length&lt;/span&gt;
&lt;span class="c1"&gt;// item&lt;/span&gt;
&lt;span class="c1"&gt;// namedItem&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Whoa&lt;/em&gt;, secret properties. So this is why an HTML collection is a bit more substantial than a mere array. But let's get into the far superior querySelectorAll to see why I make that claim in the first place.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;divList&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;section div&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;divList&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;//=&amp;gt; NodeList(7) [div, div, div, div, div, div, div]&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;divItems&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// will output :&lt;/span&gt;
 &lt;span class="c1"&gt;//   &amp;lt;div&amp;gt;Hey&amp;lt;/div&amp;gt;&lt;/span&gt;
 &lt;span class="c1"&gt;//   &amp;lt;div&amp;gt;it's&amp;lt;/div&amp;gt;&lt;/span&gt;
 &lt;span class="c1"&gt;//   &amp;lt;div&amp;gt;a&amp;lt;/div&amp;gt;&lt;/span&gt;
 &lt;span class="c1"&gt;//   &amp;lt;div&amp;gt;whole&amp;lt;/div&amp;gt;&lt;/span&gt;
 &lt;span class="c1"&gt;//   &amp;lt;div&amp;gt;bunch&amp;lt;/div&amp;gt;&lt;/span&gt;
 &lt;span class="c1"&gt;//   &amp;lt;div&amp;gt;of&amp;lt;/div&amp;gt;&lt;/span&gt;
 &lt;span class="c1"&gt;//   &amp;lt;div&amp;gt;divs!&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alright so far, pretty much the same. Except it's called a &lt;em&gt;NodeList&lt;/em&gt;. Whatever, right? But hang on, let's try to read it like an object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;divItems&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// will output the following (numbers on one line for readability)&lt;/span&gt;
&lt;span class="c1"&gt;// 0, 1, 2, 3, 4, 5, 6&lt;/span&gt;
&lt;span class="c1"&gt;// entries&lt;/span&gt;
&lt;span class="c1"&gt;// keys&lt;/span&gt;
&lt;span class="c1"&gt;// values&lt;/span&gt;
&lt;span class="c1"&gt;// forEach&lt;/span&gt;
&lt;span class="c1"&gt;// length&lt;/span&gt;
&lt;span class="c1"&gt;// item&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And there's why I like a NodeList more. It has the forEach method available for use because it is inherited from its Prototype (maybe I'll write about that later). If you expand the console.log for the HTML/Node collection as a whole and look at the last entry, you can spot the additional object 'keys' that are read by a For...in loop.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvbakjsf7rzy6ghjo22zd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvbakjsf7rzy6ghjo22zd.png" alt="console.log for a HTML collection"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Peering inside our HTML collection entry.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So if your goal is to iterate through bunch of HTML elements on a page, your best best is to querySelectorAll those bad boys and either use a For...of loop or a forEach method on them.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;Use a For... &lt;strong&gt;of&lt;/strong&gt; loop on an array when you want to know the 1st, 2nd, or nth item &lt;strong&gt;of&lt;/strong&gt; the array. Use a For... &lt;strong&gt;in&lt;/strong&gt; loop on an object when you want to see the key:value pairs &lt;strong&gt;in&lt;/strong&gt;side it. HTMLCollections and NodeLists are both a type of array, but only a NodeList has access to the forEach method.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thanks for reading!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>Precipitates, Plato, and Programming</title>
      <dc:creator>Sergio B</dc:creator>
      <pubDate>Sat, 09 Apr 2022 17:20:52 +0000</pubDate>
      <link>https://dev.to/sberdup/precipitates-plato-and-programming-16ea</link>
      <guid>https://dev.to/sberdup/precipitates-plato-and-programming-16ea</guid>
      <description>&lt;p&gt;To say that software development was always in my future would be a great exaggeration. Sure, I loved video games and computers growing up, but I wasn’t truly aware of the backstage code making it all possible and was more than content to just chicken-peck my keyboard well into high school. Similarly, my experience with school during that time was that I enjoyed learning things in most classes, but there weren’t any that inspired me to step into their greater depths of knowledge. The first one to defy this norm for me was 10th grade chemistry. This subject struck a nice balance between physical and mathematical theories that weren’t much by themselves, and the practice of thoughtful experimentation, to reveal something fundamentally amazing about the universe. Outside of this passion, I had a great appreciation for geometry, French, and even psychology but none could compete with the hands-on aspect of chemistry. &lt;/p&gt;

&lt;h2&gt;
  
  
  A New World
&lt;/h2&gt;

&lt;p&gt;It wasn't until my digital electronics class two years later that I once again had a class that let me take my knowledge and test it out in the real world. In this class, we were introduced to Boolean logic and gradually guided from there to understand logic gates. Some time after that, we were capable of designing large-scale systems on a breadboard with capacitors, resistors, and many, many wires that would be capable of carrying out a simple objective autonomously. &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LYfXfxWS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1zh93f2z3qtvoncxc945.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LYfXfxWS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1zh93f2z3qtvoncxc945.png" alt="A breadboard." width="880" height="657"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;A circuit board that displayed my birthdate on an LED display.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I was so obsessed with all this that one day at my friend's house, I realized the light switch at the top and bottom of his staircase &lt;strong&gt;both&lt;/strong&gt; controlled the &lt;em&gt;same&lt;/em&gt; bulb. Applying what I’d learned, I immediately drew up a truth table for all the switch positions and recorded the lightbulb's "output". I was ecstatic when I discovered that whatever wiring was connecting the two switches to the bulb behaved exactly like a XOR gate. Unfortunately, my friend did not share the same elation and we swiftly moved on to our task of shooting virtual zombies on his PS3, powered by more transistors and logic circuits than either of us could conceive of.  &lt;/p&gt;

&lt;p&gt;One year and some months after that, I found myself at CU Boulder, totally set to rock my way through the next three years of a chemical engineering degree. The first year had been interesting because I was learning my new rhythm of having independence (albeit in a campus dorm room of ~150 square feet shared with another person) and getting to learn all sorts of new things in algebra, chemistry, and introductory engineering. I was doing quite well but other than my writing course where we had lively discussions hosted by a professor with a passion for inspiring our curiosity, I didn't really feel like I was having an experience worth half of a brand spanking new Subaru Outback. &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3EBuXQBQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g3l0xesii56hicoxe9oj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3EBuXQBQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g3l0xesii56hicoxe9oj.png" alt="2023 Subaru Outback" width="880" height="587"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Lovely&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is, until I reached sophomore year and got into both my Greek philosophy and introduction to computer engineering courses. Here were two classes, on different ends of the conceptual-to-actual spectrum, with dedicated instructors who clearly had a great deal of knowledge and interest in their subject. Through philosophy, I was introduced to some of the earliest conceptions of formalized logic and reasoning that figures from Plato to Diogenes Laertius would use to try and sort out everything from making a government, to why the sun is probably a giant ball of fire really far away from us. Meanwhile, in my computer engineering course, we were introduced to basic programming languages including Microsoft’s Visual Basic in Excel and Matlab’s proprietary language. These were used as vehicles for us to craft programs and functions, conceived in theory and ultimately executed with real data, to obtain concrete figures and plans for the purposes of engineering. &lt;/p&gt;

&lt;h2&gt;
  
  
  A New Way of Thinking
&lt;/h2&gt;

&lt;p&gt;Through everything I learned and all the tests I passed in my two years at college, the one thing that stuck with me more than anything else was a function I wrote for that engineering class. It wasn’t a very complicated function I needed to program but it took me the better part of a day to reason through. I remember thinking through the problem conceptually and figuring out the different cases my algorithm would need to account for and what kinds of data I should expect. The objective was to write a function that would accept two circles given the radius of each, along with the distance between the two circles. The function would then need to calculate the area taken up by the two circles, including the case where they overlap, without double counting any area. I remember getting to the end of my coding, plotting a sample curve to test whether my program worked, and just staring at the resulting graph. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3ET8R3RW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a40wb2r9412gph5wyvol.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3ET8R3RW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a40wb2r9412gph5wyvol.png" alt="My beautiful area plot." width="547" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;My function plotted for circles of radius 1 and 2, from a distance of 0 to 4 units.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It was exactly what I was imagining but it was a testament to the true power of logic and computation to bring a concept out like that into the real world. And that’s also what led me to realize I had chosen the wrong major. &lt;/p&gt;

&lt;h2&gt;
  
  
  To Begin Again
&lt;/h2&gt;

&lt;p&gt;After a long bout with myself and careful stock of my situation, I decided to return home and focus on many aspects of my health I’d completely neglected in the single-minded pursuit of being able to say I got a chemical engineering degree. I ended up working real jobs for a while, a harsh contrast to the only one I’d held before as the overnight receptionist for the campus dorm halls. I worked at grocery stores for a couple of years before moving into retail where I was able to go from unloading trucks at 5 AM on a conveyor line, to running a whole department by myself. And after a couple years of that, I decided I’d had enough and joined Amazon to start from the bottom again. &lt;/p&gt;

&lt;p&gt;Coincidentally, I ended up in the stow department focusing on something much akin to merchandising at my previous workplace. Although this place was in large part run by algorithms talked about by my coworkers as if they were pagan gods or some force of nature. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I'd hear things like, &lt;em&gt;“the &lt;strong&gt;system&lt;/strong&gt; doesn’t like it when you try and put two similar items in the same bin!”&lt;/em&gt; and &lt;em&gt;“the &lt;strong&gt;system&lt;/strong&gt; goes around trying to clean up any little mistake we make.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Over the next two years, I gained a lot of experience and slowly formed a picture of how the processes in the warehouse flowed and even got to learn how to troubleshoot them using our inventory website. Now, it’s clear to me how people’s interactions with the digital systems built into and behind the scenes of every Amazon warehouse influence the environment and culture of such a workplace. Seeing this and reflecting on my past experiences and the opportunity Amazon has put in front of me through Flatiron School fills me with resolve.  &lt;/p&gt;

&lt;h2&gt;
  
  
  To the Future
&lt;/h2&gt;

&lt;p&gt;I don’t have a “master plan” for what I want from software development but I do have 3 goals in mind:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Gain more autonomy in my career options, hopefully starting out with a higher-paying position within or close to my current Amazon Fulfillment Center. &lt;/li&gt;
&lt;li&gt;Host my own website that I will build to represent me, my interests, and any fun or interesting projects I choose to share. &lt;/li&gt;
&lt;li&gt;Learn enough about mobile development to work on my own grocery list app, partially inspired by living with my roommates.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I am learning how to learn more than I ever did in all my schooling and I can’t wait to be challenged more than I’ve ever been in this bootcamp. I am excited to begin a new journey of discovery and enter into a community of people making things we rely on that not everyone really stops and thinks about. Lastly, I am looking forward to sharing what I learn and getting to know people extraordinarily different from myself that will also use this medium to turn their conceptions into reality.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>career</category>
    </item>
  </channel>
</rss>
