<?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: Amanda Mendez</title>
    <description>The latest articles on DEV Community by Amanda Mendez (@panpan).</description>
    <link>https://dev.to/panpan</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%2F1199620%2F3403dd6b-ff6c-4537-9f7d-9c6f4ced0139.jpeg</url>
      <title>DEV Community: Amanda Mendez</title>
      <link>https://dev.to/panpan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/panpan"/>
    <language>en</language>
    <item>
      <title>More Ruby newbie time: The importance of 'making the invisible visible' as a beginner (featuring the Date class)</title>
      <dc:creator>Amanda Mendez</dc:creator>
      <pubDate>Tue, 14 Nov 2023 04:08:47 +0000</pubDate>
      <link>https://dev.to/panpan/more-newbie-time-the-importance-of-making-the-invisible-visible-as-a-beginner-featuring-the-date-class-1ojn</link>
      <guid>https://dev.to/panpan/more-newbie-time-the-importance-of-making-the-invisible-visible-as-a-beginner-featuring-the-date-class-1ojn</guid>
      <description>&lt;p&gt;Today, a lesson that I've learned throughout my journey as an educator, has cropped up again. That's the importance of breaking things down into smaller, easier-to-grasp parts. One way to do this in programming was introduced in the online class I'm taking. They introduced the concept of 'making the invisible visible' when programming.&lt;/p&gt;

&lt;p&gt;How do you do this? By printing as much as you can when you can. &lt;/p&gt;

&lt;p&gt;This probably seems obvious after you've had years of experience, or maybe you're already a programming wizard who doesn't even need to use this as a crutch anymore. But for the beginner it's so essential to building a good foundation in programming. &lt;/p&gt;

&lt;p&gt;So let's take this example from a little beginner coding challenge:&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;THE DATE CLASS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Write a program to identify different parts of today's date and print a String result. For any given date, the output should be:&lt;/p&gt;

&lt;p&gt;"The year is: XXXX, the calendar day is: X, and the month is: X."&lt;/p&gt;

&lt;p&gt;Use the exact same copy ("The year is..."), but replace "X" with your calculated date. Don't forget to &lt;code&gt;require "date"&lt;/code&gt;&lt;/p&gt;




&lt;p&gt;So where do we start? &lt;/p&gt;

&lt;p&gt;Well thanks to some context clues, we know we're going to be working with the &lt;strong&gt;Date class&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;I think here is the first small part we have to make sure we understand. What is a class and why do we have to use &lt;code&gt;require "date"&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;So &lt;strong&gt;Date&lt;/strong&gt; is a class. As I understand it, this means it is a pre-built piece of code that's already been written to make it easier for us so we &lt;strong&gt;don't&lt;/strong&gt; have to create a program that works with dates ourselves. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Phew! Thanks to whoever made the Date class!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now another important thing to note is that if we want to use this super handy class someone made for us already, it's not already pre-loaded in a default Ruby program, so you have to always start with &lt;code&gt;require "date"&lt;/code&gt; to tell Ruby to get access to that pre-made class.&lt;/p&gt;

&lt;p&gt;Great so we can write the first part of our program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s2"&gt;"date"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So what's next? &lt;/p&gt;

&lt;p&gt;Well we have access to the Date class now, so let's use it! Erm...How do we use it? Well the simple answer is by combining it with methods. Methods are also prebuilt pieces of code that make our lives easier. So how can we use them?&lt;/p&gt;

&lt;p&gt;Well in this example, the method we'll need to use is &lt;code&gt;.today&lt;/code&gt;. To use this method, you have to "plug it into" something. In this case, we'll "plug it into" the Date class. I kind of think of the period before the method name as a little plug that connects it to whatever it comes behind. By using this method, we will have access to all the info the program needs to know the current date. &lt;/p&gt;

&lt;p&gt;So we can guess that we'll need to plug our &lt;code&gt;.today&lt;/code&gt; method into the Date class. Let's say something like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;today&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nice! But we can't really do anything with that. It's kind of just information right now sitting there chilling. &lt;/p&gt;

&lt;p&gt;How can we use it? Enter the variable&lt;/p&gt;

&lt;p&gt;So I think of variables as boxes. They are boxes we can hold information in. But what if we have tons of boxes? How are we going to remember which box holds what? That's the beauty of variables in our programs. We can label these boxes anything we want to make them easier to keep track of. I think of it like writing in a big permanent marker, a label on a cardboard box. &lt;/p&gt;

&lt;p&gt;So how do we box and label. Here's how I would do it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s2"&gt;"date"&lt;/span&gt;
&lt;span class="n"&gt;date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;today&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So I just put all the information that is included in our &lt;code&gt;Date.today&lt;/code&gt; method into my box which I've labeled with my big permanent marker 'date'. It's important to note that I could have called it anything really though. I went with 'date' to remember what's in that box more easily. &lt;/p&gt;

&lt;p&gt;Ok now enter the whole concept of making the invisible visible. Let's take a peek inside the 'date' box and see what's inside!&lt;/p&gt;

&lt;p&gt;The best way to do this is by adding some kind of print function in front of our variable so we can see what's inside. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s2"&gt;"date"&lt;/span&gt;
&lt;span class="n"&gt;pp&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;today&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will allow us to run our program so far, and see exactly what we're working with. After you run your program, the result would be something like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#&amp;lt;Date: 2023-11-14 ((2460263j,0s,0n),+0s,2299161j)&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cool! That's all the information that's stored in our 'date' box or variable. We have plenty to work with to complete the date class challenge above! Let's revisit the challenge briefly:&lt;/p&gt;




&lt;p&gt;Write a program to identify different parts of today's date and print a String result. For any given date, the output should be:&lt;/p&gt;

&lt;p&gt;"The year is: XXXX, the calendar day is: X, and the month is: X."&lt;/p&gt;




&lt;p&gt;So we need the four-digit year, day, and month! All of that's already in our 'date' box!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now we just gotta get it outta there somehow 🤔.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's make more boxes!&lt;/p&gt;

&lt;p&gt;We need a year, month, and day box. Let's do that first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s2"&gt;"date"&lt;/span&gt;
&lt;span class="n"&gt;date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;today&lt;/span&gt;

&lt;span class="c1"&gt;#define variables&lt;/span&gt;
&lt;span class="n"&gt;year&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
&lt;span class="n"&gt;month&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; 
&lt;span class="n"&gt;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ok we have boxes, but now how do we pull that information out of the bigger date box and put it in the smaller boxes?&lt;/p&gt;

&lt;p&gt;The answer is methods! It's going to kind of be like a method-ception idea here, but that's why the box imagery works so well I think. Remember we can plug methods into things with a '.'&lt;/p&gt;

&lt;p&gt;How do we do this for the first box or variable called 'year'?&lt;/p&gt;

&lt;p&gt;First we have to refer to the box we want to take the information out of. That would be the date box. Then we have to tell it exactly what information to pull out of that box using a method. In this case if we use &lt;code&gt;.year&lt;/code&gt; we can pull the year out of the 'date' box!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s2"&gt;"date"&lt;/span&gt;
&lt;span class="n"&gt;date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;today&lt;/span&gt;

&lt;span class="c1"&gt;#define variables&lt;/span&gt;
&lt;span class="n"&gt;year&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;year&lt;/span&gt;
&lt;span class="n"&gt;month&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; 
&lt;span class="n"&gt;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now is a great time to apply the 'making the invisible visible' concept we've been talking about. Let's see what's in that new box we made by printing it!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s2"&gt;"date"&lt;/span&gt;
&lt;span class="n"&gt;date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;today&lt;/span&gt;

&lt;span class="c1"&gt;#define variables&lt;/span&gt;
&lt;span class="n"&gt;pp&lt;/span&gt; &lt;span class="n"&gt;year&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;year&lt;/span&gt;
&lt;span class="n"&gt;month&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; 
&lt;span class="n"&gt;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output should be something like this (assuming you're reading this in the year it was written. If not it will be your current year.):&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Nice! Now we can just apply the same idea to the remaining two boxes or variables. Here's what we're left with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s2"&gt;"date"&lt;/span&gt;
&lt;span class="n"&gt;date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;today&lt;/span&gt;

&lt;span class="c1"&gt;#define variables&lt;/span&gt;
&lt;span class="n"&gt;year&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;year&lt;/span&gt;
&lt;span class="n"&gt;month&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;month&lt;/span&gt;
&lt;span class="n"&gt;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;year&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can similarly print all the variables to see what they're holding. &lt;/p&gt;

&lt;p&gt;Then you just have to cook up your string to print! If you use string interpolation, it's pretty straightforward:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s2"&gt;"date"&lt;/span&gt;
&lt;span class="n"&gt;date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;today&lt;/span&gt;

&lt;span class="c1"&gt;# define variables&lt;/span&gt;
&lt;span class="n"&gt;year&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;year&lt;/span&gt;
&lt;span class="n"&gt;month&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;month&lt;/span&gt;
&lt;span class="n"&gt;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;year&lt;/span&gt;

&lt;span class="c1"&gt;# print the string&lt;/span&gt;
&lt;span class="n"&gt;pp&lt;/span&gt; &lt;span class="s2"&gt;"The year is: &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;year&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;, the calendar day is: &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;day&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;, and the month is: &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;month&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should complete the challenge! I hope this could help illustrate the concept of 'making the invisible visible' when building your foundations as a programmer. At least it's been helpful to me so far!&lt;/p&gt;

&lt;p&gt;Thanks for reading and happy coding! 😀&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>ruby</category>
      <category>learning</category>
    </item>
    <item>
      <title>Ruby newbie time: Grasping "array-ception" in Ruby</title>
      <dc:creator>Amanda Mendez</dc:creator>
      <pubDate>Thu, 09 Nov 2023 01:02:10 +0000</pubDate>
      <link>https://dev.to/panpan/ruby-newbie-time-grasping-array-ception-in-ruby-2k0d</link>
      <guid>https://dev.to/panpan/ruby-newbie-time-grasping-array-ception-in-ruby-2k0d</guid>
      <description>&lt;p&gt;Being fairly new to programming, I start struggling following the logic of the code once I hit topics like loops, arrays, or hash. Not to mention when they all start to combine. Then my head kind of just starts exploding. 🤯&lt;/p&gt;

&lt;p&gt;Today I'm learning Ruby and worked on this (courtesy &lt;a href="https://www.codecademy.com/enrolled/courses/learn-ruby"&gt;Codeacademy's Learn Ruby course&lt;/a&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="s2"&gt;"ham"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"swiss"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"turkey"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"cheddar"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"roast beef"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"gruyere"&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;

&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;sub_array&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="n"&gt;sub_array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To try to understand it better I'll try to break it down starting with the first part:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="s2"&gt;"ham"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"swiss"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"turkey"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"cheddar"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"roast beef"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"gruyere"&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the above is what I've dubbed "array-ception". There are three inner-arrays within a larger outer array. Those inner arrays are some run-of-the-mill sandwich combinations: ["meat, "cheese"].&lt;/p&gt;

&lt;p&gt;Ok. Makes sense so far right? But what about when we want to start doing things with these "array-ceptions"? For example in our initial code snippet, we're trying to write a simple program where we can just print every element of each array.&lt;/p&gt;

&lt;p&gt;I can't be the only beginner who has ever thought, &lt;em&gt;"Where do I even start?"&lt;/em&gt;, &lt;em&gt;"What's going on?"&lt;/em&gt;, or &lt;em&gt;"All this thinking about sandwiches is making me hungry."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I suppose since there are kind of two parts, the larger outer array and the smaller inner arrays, we should start tackling the outer array first. I think that's what comes next in the code anyway:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;sub_array&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're like me, this is where it starts to get confusing. If there's anything I've learned, it's that when things are confusing, they're begging to be broken down even further. &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Part 1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So let's start with the variable &lt;strong&gt;'s'&lt;/strong&gt;. It seems like &lt;strong&gt;'s'&lt;/strong&gt; is kind of a good way to keep track of that larger outer array we talked about earlier. So that means that &lt;strong&gt;'s.each'&lt;/strong&gt; probably means something like &lt;em&gt;"For each element in the larger outer array called &lt;strong&gt;s&lt;/strong&gt;, do something..."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ok great! Making more sense now!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now we just have to contend with the pesky &lt;strong&gt;'do |sub_array|'&lt;/strong&gt; part. So what does it mean? What are we doing?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Uaop29h_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ziubpwk1keojob708uva.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Uaop29h_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ziubpwk1keojob708uva.gif" alt="Jack Skellington What does it mean gif" width="480" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Part 2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Well, codeacademy did a great job by naming the variable &lt;strong&gt;'sub_array'&lt;/strong&gt; because we can assume that to mean we're going to start tackling the inner arrays I mentioned earlier. So that means &lt;strong&gt;|sub_array|&lt;/strong&gt; is pointing us to each smaller array like &lt;strong&gt;'["ham", "swiss"]'&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Alright so that's making more sense. Seems like that part we can assume to mean something like &lt;em&gt;'do something to the inner arrays...'&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So putting parts 1 and 2 together means &lt;em&gt;"For each element in the larger outer array called &lt;strong&gt;s&lt;/strong&gt;, do something to the inner arrays called &lt;strong&gt;sub_array&lt;/strong&gt;..."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Woohoo! I think we got the first part down.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Part 3&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that that's cleared up, we can tackle the next part:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;sub_array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hmmm... this should be looking familiar. 🤔 Actually now that I look at it it's basically exactly the same except for the variables named. So instead of doing something to the larger array, we're now starting with the inner arrays or sub arrays. &lt;/p&gt;

&lt;p&gt;What's confusing to me here is &lt;strong&gt;'|y|'&lt;/strong&gt;. What is it?? Where did it come from? To make it easier to follow in my head, I'd probably change the variable name to something like &lt;strong&gt;'smallest_element'&lt;/strong&gt; because here I think &lt;strong&gt;'y'&lt;/strong&gt; is just tracking each inner element of the sub arrays. That's the smallest part the arrays can be broken down into. &lt;/p&gt;

&lt;p&gt;So I'd think of it more like this: &lt;code&gt;sub_array.each do |smallest_element|&lt;/code&gt;. And to translate that to plain English, it'd be something like, &lt;em&gt;"For each sub array do something to the smallest element in the array."&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Cool! I think we can put it all together now.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So parts 1-3 would translate to something like. &lt;em&gt;"For each element in the larger outer array called &lt;strong&gt;s&lt;/strong&gt;, do something to the inner arrays called &lt;strong&gt;sub_array&lt;/strong&gt;. What are we doing to the inner arrays? Well, for each inner array, do something to the smallest element in that array called &lt;strong&gt;y&lt;/strong&gt;."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Ok. I can follow the logic so far, but I haven't actually done the big 'something' that we've been alluding too. The anticipation is killing me. What are we going to do to those smaller elements?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's where the last part of the code comes in. It's the final flourish of our little program. We're going to simply &lt;strong&gt;'puts y'&lt;/strong&gt; meaning we want to display each of the smallest elements of the array on a new line.&lt;/p&gt;

&lt;p&gt;And that's it! The output should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ham
swiss
turkey
cheddar
roast beef
gruyere
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hopefully that helped you out if you were having trouble following the logic. It certainly helped me to try to type it out to explain it anyway.&lt;/p&gt;

&lt;p&gt;And keep in mind I'm a beginner and learning along with you. Or maybe you're more advanced, in which case, don't hesitate to correct me if I've made an error. &lt;/p&gt;

&lt;p&gt;See you in the next post!&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>beginners</category>
      <category>programming</category>
      <category>learning</category>
    </item>
    <item>
      <title>Starting the Full Stack journey</title>
      <dc:creator>Amanda Mendez</dc:creator>
      <pubDate>Wed, 08 Nov 2023 00:43:41 +0000</pubDate>
      <link>https://dev.to/panpan/starting-the-full-stack-journey-53m</link>
      <guid>https://dev.to/panpan/starting-the-full-stack-journey-53m</guid>
      <description>&lt;p&gt;About a year ago, I decided to try a career transition from teaching and music into tech. I started with the ambition of becoming and SDET. It's been tough, but I'm still here.&lt;/p&gt;

&lt;p&gt;I recently got the opportunity to possible be considered for a full stack apprenticeship. Nothing is certain, but I'll give it my best shot. &lt;/p&gt;

&lt;p&gt;Today I made my very &lt;a href="https://amanda-linkinbio.onrender.com/"&gt;first full stack project&lt;/a&gt;. It's quite a bit different than what I'm used to coming from a Java background in software testing, but it was kind of fun!&lt;/p&gt;

&lt;p&gt;Let's see where this journey takes me! &lt;/p&gt;

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