<?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>Forem: AnneMiriam</title>
    <description>The latest articles on Forem by AnneMiriam (@annemiriam).</description>
    <link>https://forem.com/annemiriam</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%2F1157936%2Fb79f313a-684a-4070-baa2-be7f15a60989.jpeg</url>
      <title>Forem: AnneMiriam</title>
      <link>https://forem.com/annemiriam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/annemiriam"/>
    <language>en</language>
    <item>
      <title>Finally Made It Through the Fog!</title>
      <dc:creator>AnneMiriam</dc:creator>
      <pubDate>Fri, 16 Feb 2024 00:31:02 +0000</pubDate>
      <link>https://forem.com/annemiriam/finally-made-it-through-the-fog-e5f</link>
      <guid>https://forem.com/annemiriam/finally-made-it-through-the-fog-e5f</guid>
      <description>&lt;p&gt;Well, here we are! I have finally made it to week 15 of my 15 week boot camp at Flatiron School. 22 weeks ago I wasn't sure I was going to make it. Learning full stack development(4 languages) in 12 weeks with 3 weeks for a final capstone project seemed impossible. &lt;/p&gt;

&lt;p&gt;I had started my Javascript journey some time at the end of 2022, with a 4 hour intro to JS offered by another boot camp. I applied to Flatiron because it was 3 weeks longer than most boot camps, and it offered some help navigating the job search after completion. I was accepted in the spring of 2023 and so, by June, I was able to start the phase 0. Phase 0, or the pre-course, aims to get you going on JS before you start the official boot camp, and I struggled a bit to complete it. I kept doubting that I could figure it out. Foreign languages are hard!&lt;/p&gt;

&lt;p&gt;I started phase 1 in the middle of September. I felt like some fundamentals were starting to click, but arrays and objects were tripping me up. I failed the first code challenge, but I figured I still had a week to figure it out. Then I failed the second code challenge, which meant I failed the phase.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy9zy8h7gs4oth2vkykdd.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy9zy8h7gs4oth2vkykdd.jpeg" alt="Barbie breakdown" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I had been so close, too. All I needed was a parseInt(), but for the life of me a couldn't recall how it worked.&lt;br&gt;
It should have looked something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkq3gdzkw1ko33rnanws5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkq3gdzkw1ko33rnanws5.png" alt="CC redo" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In retrospect I also realised that I had failed to subtract tickets sold from the capacity to get the remaining tickets. 🤦‍♀️&lt;br&gt;
*read instructions carefully!&lt;/p&gt;

&lt;p&gt;At Flatiron you are allowed 1 repeat. So, the process was started to move me into the next cohort. Although, thankfully, they don't have you repeat immediately. There was a cohort starting the very next week (Oct 2), but they like to stagger the repeat meaning I would join the cohort after the next, so Oct 30th was my new start date. That meant I had a whole month to get ready for round 2. &lt;/p&gt;

&lt;p&gt;My sister, who is a Front-end SE herself, gifted me a Udemy course on how to become a Web Developer. I didn't get all the way through it, in fact I don't think I even touched the back-end portion, but the beginning of that course was all about JavaScript. I skipped through the HTML and CSS portions, planning to go back when I had the time(which I haven't had). I focused on just the JS stuff, and suddenly learning the same things I had just learned for 3+ weeks finally started to make sense. I finally understood what the heck a Modulo is!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv80k1r5x8vq4qyqz49ip.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv80k1r5x8vq4qyqz49ip.png" alt="modulo explained" width="600" height="450"&gt;&lt;/a&gt;&lt;br&gt;
When it came time to start on Oct 30th, JS made a lot more sense. Which in turn helped React(Phase 2) make sense.&lt;/p&gt;

&lt;p&gt;Phase 3 at Flatiron is all about diving into the backed with Python. The delete and repeat approach with the labs, I learned in React, helped a lot with getting past the code challenges. Having JS under my belt, also, helped make Python a little less daunting, it was a lot about the changes in syntax. Of course, however, I continued to have a voice in my head that said it will never make sense. But that voice was never as loud as it was in week 1 of my first cohort.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjx5qu9m71nuvnznfiwm0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjx5qu9m71nuvnznfiwm0.jpg" alt="Cant hear u peach" width="800" height="565"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Phase 4(Flask) zipped by in a blur, and now here I am standing at the end. That fog that I thought I would never see through had finally started to lift. I feel that I still have a ways to go in my learning, but at least now I have a good foundation. There will be a lot of continued studying on my own. Perhaps, I'll finally finish that Udemy course.&lt;/p&gt;

&lt;p&gt;I'm super excited to present my capstone project. A social app where people can share their beloved collections of things they saved from their childhood, or even things that they got as adults that mean a lot to them. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnu7aorwpsmd9g8ljnllg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnu7aorwpsmd9g8ljnllg.png" alt="My web app" width="800" height="579"&gt;&lt;/a&gt;&lt;br&gt;
My hope is that eventually it will have a forum on it, where users can post inquiries about finding a certain item. That portion came to mind as I had been thinking of how I could find something I've searched the internet for, for years, and ultimately how the idea for this app came to be. &lt;br&gt;
*There was a VHS tape featuring episodes of the Chipmunks, that I LOVED as a child, to the point that it no longer plays properly. I have searched for years to find another copy. I thought if there had been a place where like minded people could post such searches it would be helpful. It also didn't help that searching the title of the video brought up another, more accessible, Chipmunks movie.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is she rambling about?&lt;/strong&gt;&lt;br&gt;
The point I'm trying to make is if you are thinking of going to a coding boot camp, or maybe you have already started one and are feeling overwhelmed. &lt;strong&gt;Don't give up&lt;/strong&gt;. It is hard work, but if you commit to trying you may surprise yourself. You could be standing with me at the finish line, wondering where did the last 3-4 months go? &lt;br&gt;
Some words of wisdom that I repeated to myself:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq37m01pta0luihmf0ua6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq37m01pta0luihmf0ua6.jpg" alt="Keep swimming" width="500" height="500"&gt;&lt;/a&gt;&lt;br&gt;
And if your anxiety is trying to derail you:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fklrobmtica4a7j6crb86.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fklrobmtica4a7j6crb86.jpg" alt="Clear Skies" width="564" height="564"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Clear skies, clear skies!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;*I did actually find the video back in December on eBay. Now I need to find a VCR that works!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fevqlmamcu80whfnnegbw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fevqlmamcu80whfnnegbw.jpeg" alt="Around the World with the Chipmunks" width="800" height="919"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Image Sources&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
The Fog and other personal images - by Anne Hastings&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The following images may be subject to copyright&lt;/em&gt;&lt;br&gt;
&lt;a href="https://www.meracalculator.com/math/modulo.php"&gt;https://www.meracalculator.com/math/modulo.php&lt;/a&gt;&lt;br&gt;
Disney - Finding Nemo, Encanto&lt;br&gt;
The Barbie Movie&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>python</category>
    </item>
    <item>
      <title>You Faker</title>
      <dc:creator>AnneMiriam</dc:creator>
      <pubDate>Sat, 27 Jan 2024 01:21:44 +0000</pubDate>
      <link>https://forem.com/annemiriam/you-faker-6im</link>
      <guid>https://forem.com/annemiriam/you-faker-6im</guid>
      <description>&lt;p&gt;Here we are at the end of week 12 at Flatiron School. In this phase, p4, my cohort mates and I were introduced to Flask. We're finally working with back-end and tying it into our front-end(React). It has been really exciting, but also very nerve-racking. We are so close to the finish line, only 3 weeks to go, but we also now have to go back and remember that stuff we possibly haven't touched in 5 weeks, because we were so focused on learning Python. &lt;/p&gt;

&lt;p&gt;And did I mention Deployment? 🤯 Trying to weed my way through that whole process has begun to add a whole new level of stress. But that's another story.&lt;/p&gt;

&lt;p&gt;I have been feeling the imposter syndrome a lot this last week. Getting back into React things looked familiar, but I felt like I didn't know what I was doing. I kinda felt like I was faking it! Which happens to be something Python can do, with the Faker library.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Faker?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Faker is a Python library that allows developers to create fake data, such as names, addresses, sentences, and email addresses. It gives you a simple way to produce random data that looks like real information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Would I Want to Use Faker?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is good for testing or simulating interactions. We all likely  encountered it in our phase 4 projects, as we had to create databases that shared connections with other databases in one-to-many and many-to-many relationships. It would have taken a lot of time to manually fill in those databases with information that we would have had to make up anyway. So, in comes Faker.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Let's look at what Faker can do!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Faker can create names:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;name() = a random full name&lt;/li&gt;
&lt;li&gt;first_name() = a random first name only&lt;/li&gt;
&lt;li&gt;last_name() = a random last name only&lt;/li&gt;
&lt;li&gt;prefix() = a random prefix(Mr., Dr., Ms., etc)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Faker can create locations and addresses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;email() = a random email address&lt;/li&gt;
&lt;li&gt;address() = a random street address&lt;/li&gt;
&lt;li&gt;city() = a random city name&lt;/li&gt;
&lt;li&gt;state() = a random state name or abbreviation&lt;/li&gt;
&lt;li&gt;country() = a random country name&lt;/li&gt;
&lt;li&gt;url() = a random URL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Faker can create dates and times:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;date_of_birth() = a random date of birth&lt;/li&gt;
&lt;li&gt;date() = a random date&lt;/li&gt;
&lt;li&gt;time() = a random time&lt;/li&gt;
&lt;li&gt;date_time() = a random date and time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Faker can create writing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;text() = a random paragraph(non-sensical) &lt;/li&gt;
&lt;li&gt;sentence() = a random sentence(non-sensical)&lt;/li&gt;
&lt;li&gt;word() = a random word&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those are just a sample. Faker can also create phone numbers, credit card information, numbers, and colors, to name a few more.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Lets see how it looks in our code 👇🏻&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv92vdts40tnw1f24o57z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv92vdts40tnw1f24o57z.png" alt="Faker code snippet" width="800" height="906"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F14vjd505o6xutildztne.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F14vjd505o6xutildztne.png" alt="Output from Faker snippet" width="724" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Those all look reasonably real, if you don't look too close.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Faker's limitations&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Faker can randomize locations, but it is limited to predefined locations. So, if you are trying to generate data for a specific region, it may not work.&lt;/p&gt;

&lt;p&gt;Also, if I try to look up any of the output from above, like South Cynthia, in Google Maps, the first match for a destination is S. Cynthia St., McAllen, TX. It is not a town in Oklahoma. When I look up the zip code, I found that it belongs New Orleans, LA. Another run of the same code gave me the postal code, 26368, for a city called Kupinik, in Serbia. Not South Adam, MO.&lt;br&gt;
If we look at the phone number, the country code(+1) is the USA, but the area code does not currently  exist. 375 is the country code(+375) for Belarus. &lt;br&gt;
*Fun Fact - on a little further digging, according to KMPH Fox 26, the Central Valley will be getting a 375 area code once they run out of 559 numbers.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Where does Faker really struggle?&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Like I said above, if you don't look to close, the output looks good. But is there a situation where it's obviously not real?&lt;br&gt;
Yes!&lt;br&gt;
I give you: sentence()!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgtbtvhrs9vxsc1g3wbt7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgtbtvhrs9vxsc1g3wbt7.png" alt="Faker sentence" width="800" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fukcgvwv74wlcqze5x55f.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fukcgvwv74wlcqze5x55f.jpg" alt="confused toddler" width="459" height="738"&gt;&lt;/a&gt;&lt;br&gt;
That sentence makes as much sense as the look on my face and that outfit(and my sister's outfit, behind me, given that it was Christmas. Ah, the 80's!).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Conclusion&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Faker has some good uses and just like anything fake, not so good uses. If your using Faker to just auto-populate some databases that aren't really going to be seen, fake away! But if that data might actually be seen or needs to make sense, your better off manually entering it.&lt;/p&gt;

&lt;p&gt;Happy Faking!&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Resources:&lt;/strong&gt;&lt;br&gt;
Tellez, M. 'New area code coming to Central Valley'. Published 21 December 2023. Retrieved on 26 January 2024, from &lt;br&gt;
&lt;a href="https://kmph.com/news/local/new-area-code-coming-to-central-valley-357-overlay-geographic-fresno-county-san-juaquin-madera-mariposa-merced-tulare-kings-counties-clovis-porterville-reedley-selma-visalia-coalinga"&gt;https://kmph.com/news/local/new-area-code-coming-to-central-valley-357-overlay-geographic-fresno-county-san-juaquin-madera-mariposa-merced-tulare-kings-counties-clovis-porterville-reedley-selma-visalia-coalinga&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Das, M. 'Faker: Python is Just a Fake Away!'. Published 9 August 2023. Retrieved on 19 January 2024 from &lt;a href="https://medium.com/@HeCanThink/faker-python-is-just-a-fake-away-ef626a0dcf8d"&gt;https://medium.com/@HeCanThink/faker-python-is-just-a-fake-away-ef626a0dcf8d&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>flask</category>
    </item>
    <item>
      <title>Let's do some decorating!</title>
      <dc:creator>AnneMiriam</dc:creator>
      <pubDate>Sat, 06 Jan 2024 00:43:33 +0000</pubDate>
      <link>https://forem.com/annemiriam/lets-do-some-decorating-2mg1</link>
      <guid>https://forem.com/annemiriam/lets-do-some-decorating-2mg1</guid>
      <description>&lt;p&gt;Just like in JS, functions are &lt;strong&gt;first-class methods&lt;/strong&gt;, meaning that they can be passed as an argument inside another function. And that's what Decorators do, they are essentially a function that you wrap around another function using the @ syntax.&lt;/p&gt;

&lt;p&gt;In Python there are a number of built in functions that we see as decorators. Some like property can be used as a decorator or as a regular function.&lt;/p&gt;

&lt;p&gt;Some common decorators include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;@classmethod &lt;/li&gt;
&lt;li&gt;@property &lt;/li&gt;
&lt;li&gt;@wraps &lt;/li&gt;
&lt;li&gt;@abstractmethod &lt;/li&gt;
&lt;li&gt;@staticmethod &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So far, in my learning, I have really only used the 1st two examples above. Lets dive into them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;@classmethod&lt;/strong&gt; &lt;br&gt;
A class method binds to the &lt;em&gt;class&lt;/em&gt; itself and not the instance, or object, of the &lt;em&gt;class&lt;/em&gt;. Class methods take the &lt;em&gt;class&lt;/em&gt; as the first argument, as "cls", rather than instance(self).&lt;br&gt;
Class methods can modify a class state that applies then to all the instances of the class.&lt;br&gt;
An example of a class method that we used:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RTsO8rHd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qpumjgxdkl454icj4ox6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RTsO8rHd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qpumjgxdkl454icj4ox6.png" alt="create_table class method" width="492" height="229"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the create_table class method, we are creating a table that maps our Enemy class to a database called enemies. This new table will persist the attributes of all Enemy instances.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;@property&lt;/strong&gt; &lt;br&gt;
Properties are attributes that are controlled by methods. We use a method to get the attribute and another method to set the attribute. The setter usually defines things like whether the attribute needs to be a string(str) or an integer(int), as well as if it's mutable or how long it can be.&lt;/p&gt;

&lt;p&gt;The property method can be written as a regular function, like so:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t4H4Kb_t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z54jwd4cqve87ogehwpe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t4H4Kb_t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z54jwd4cqve87ogehwpe.png" alt="property method" width="467" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or it can be used as a decorator, like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tEm0rL6c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oj2rme6fo0rw00qoncrl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tEm0rL6c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oj2rme6fo0rw00qoncrl.png" alt="property decorator" width="468" height="232"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The property() was created before the @decorator syntax, but the @property decorator is most often used today.
&lt;/h2&gt;

&lt;p&gt;Now, a little bit about the other examples that I listed, but didn't learn in school.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;@staticmethod&lt;/strong&gt; &lt;br&gt;
The static method, like the class method, belongs to the class itself, and not the instance of the class. But unlike @classmethod it does not have access to an instance or its attributes, and therefore cannot modify them. Hence, static - lacking in movement, action or change(Oxford Dictionary)!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0j4MzKIC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/glu7i8cnwdhcgkmz5fcj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0j4MzKIC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/glu7i8cnwdhcgkmz5fcj.png" alt="static method, math example" width="584" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What situation would you use @staticmethod: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;when you need a function that is related to the class, but doesn't depend on the state of instances.&lt;/li&gt;
&lt;li&gt;when you want to define a function that calls directly on the class.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;@abstractmethod&lt;/strong&gt; &lt;br&gt;
We did not learn about the abstract base class, but they are what use the abstract method. An example of the use for the abstract method would be on something like a Shape class that is the base class for other classes of shapes:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uZQKETuC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0z6s8edp9vko8x8xvnju.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uZQKETuC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0z6s8edp9vko8x8xvnju.png" alt="Shape base abstract method" width="360" height="666"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Above, Shape is an abstract base class with 2 defined  @abstractmethod's, are and perimeter. The Circle and the Square classes, or subclasses, must implement the abstract methods that the base class defined. If the subclasses don't implement the methods then the class becomes an abstract base class as well. And in so doing, the user won't be able to create instances, they will get a TypeError.&lt;/p&gt;

&lt;p&gt;When should you use @abstractmethod? &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;when a user wants to ensure that all subclasses of a base class implement certain methods and behaviors.&lt;/li&gt;
&lt;li&gt;when a user wants to define a base class to provide common interfaces for a group of subclasses.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;*Don't forget to import ABC and abstractmethod from abc. 😉&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;@wraps&lt;/strong&gt;&lt;br&gt;
The wraps decorator is a utility decorator that is part of Python's builtin functools module.&lt;br&gt;
A function defined with the wraps decorator gets its original metadata, behavior, and attributes preserved.&lt;br&gt;
Here are two examples of its use:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wUFxnXc2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qrxnje3tc1i4ros5vrp1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wUFxnXc2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qrxnje3tc1i4ros5vrp1.png" alt="wraps decorator log function" width="533" height="381"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;==&amp;gt; Output: "Calling function add_numbers with args: (3, 5), kwargs: {}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HfrOLnzj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kzszwx5ej65kc4ft8chr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HfrOLnzj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kzszwx5ej65kc4ft8chr.png" alt="wraps decorator wrapper function" width="502" height="511"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When to use @wraps? &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;when a user wants to define a decorator that wraps around  another function, and you want the wrapped function to preserve the metadata of the original function.

&lt;ul&gt;
&lt;li&gt;in other words: To use the wraps decorator is to create custom decorators. These custom decorators wrap other functions with the original function.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;*remember to import wraps from functools! 😉&lt;/p&gt;




&lt;p&gt;Sources:&lt;br&gt;
"classmethod() in python". @GeeksforGeeks, Sanchhaya Education Limited. Retrieved 4 Jan. 2024 from &lt;a href="https://www.geeksforgeeks.org/classmethod-in-python/"&gt;https://www.geeksforgeeks.org/classmethod-in-python/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Dr. Karhade, M. MD. PhD. "Most use python decorators: when to use and when not to". Published 22 March 2023. Retrieved on 5 Jan. 2024 from &lt;a href="https://levelup.gitconnected.com/most-used-python-decorators-when-to-use-and-when-not-to-32b8f883ee43"&gt;https://levelup.gitconnected.com/most-used-python-decorators-when-to-use-and-when-not-to-32b8f883ee43&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mwiti, D. "Python decorators tutorial". Published Oct. 2017. Retrieved on 4 Jan. 2023 from  &lt;a href="https://www.datacamp.com/tutorial/decorators-python"&gt;https://www.datacamp.com/tutorial/decorators-python&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>sql</category>
    </item>
    <item>
      <title>React Context</title>
      <dc:creator>AnneMiriam</dc:creator>
      <pubDate>Fri, 08 Dec 2023 22:36:00 +0000</pubDate>
      <link>https://forem.com/annemiriam/react-context-1fcn</link>
      <guid>https://forem.com/annemiriam/react-context-1fcn</guid>
      <description>&lt;p&gt;What is Context and when should it be used?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Context&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you first learn about React, you learn about state and props and how they are used to allow data to flow from one component to another. But what if you need to pass the same data to components that aren't parent and child to one another? Thats where Context comes in. &lt;br&gt;
Context allows us to share data "globally" between components without the need to pass props. Essentially, sharing data just got easier.&lt;br&gt;
Context has &lt;em&gt;createContext&lt;/em&gt; that helps create a context object, and &lt;em&gt;useContext&lt;/em&gt; is the hook that allows the data to be passed.&lt;br&gt;
Context avoids the need for prop-drilling - the passing down of props through multiple levels of components that don't need the prop, just to get it to a deeper nested component that does need it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PNbef4gz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ugbjy4kg2r0ok0gyre71.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PNbef4gz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ugbjy4kg2r0ok0gyre71.png" alt="Example of theme prop" width="644" height="314"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, with our example above, we see that the Interests component needs the theme, but it's parent doesn't. With prop-drilling the theme prop is passed down from the App to the Profile(where it isn't used), and then passed straight down to the Interests component.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When Should Context Be Used&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Context should be used when an element needs to be used globally. The data shouldn't need to be updated very often either.&lt;br&gt;
Examples of things that should be placed in Context:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Language&lt;/li&gt;
&lt;li&gt;Themes&lt;/li&gt;
&lt;li&gt;User data (current authenticated user) &lt;/li&gt;
&lt;li&gt;Audio (a music app)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How Do You Use Context&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first step is to create context. Here is an example from a music app I was working on.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oEL5QqeB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jh0pu6mt0y0lrvzx6csj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oEL5QqeB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jh0pu6mt0y0lrvzx6csj.png" alt="createContext" width="616" height="87"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This created a context object called MusicContext. Context data have two components the context object and the provider. Before I move on to showing the provider, I want to show that in my music app, I went ahead and called my context hook useContext.  It is paired with my context object and looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BASnVCc8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ajh5r7ci7qq9xmzybmwd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BASnVCc8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ajh5r7ci7qq9xmzybmwd.png" alt="useContext" width="331" height="75"&gt;&lt;/a&gt;&lt;br&gt;
You don't have to do it that way, you can wait and use the hook in the components where you need to call the context. The way I did it means that I just need to call my useMusicContext = value. The Value is declared by the provider 👇🏻.&lt;/p&gt;

&lt;p&gt;Here is an example of what that same music app's provider looked like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hQw0-U7O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vnk9nq3zk5nqjz70ne2e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hQw0-U7O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vnk9nq3zk5nqjz70ne2e.png" alt="ContextProvider" width="559" height="552"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The provider gives access of the context data to the child components.&lt;/p&gt;

&lt;p&gt;Here is what the component looks like all together, including it's export variables.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UUBGMG_A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ki5v4rv3x467m9udqmqp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UUBGMG_A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ki5v4rv3x467m9udqmqp.png" alt="MusicContext.js component" width="594" height="702"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that I have my Context, what do I do?&lt;/p&gt;

&lt;p&gt;The next step is to wrap the Provider component around whatever component children will need to access the data. This usually occurs in one of the top most levels in your component hierarchy.&lt;/p&gt;

&lt;p&gt;Using another example, where a UserContext and UserProvider had been created, the App component imported the UserProvider and wrapped it around the Header and Profile components, to pass down the theme.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6LH51CX---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zrdffipopkfq3ww5o1au.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6LH51CX---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zrdffipopkfq3ww5o1au.png" alt="UserContext.Provider" width="796" height="207"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qOOGbccz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dsksqvn24w93miinzf11.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qOOGbccz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dsksqvn24w93miinzf11.png" alt="Provider wrap" width="471" height="392"&gt;&lt;/a&gt;&lt;br&gt;
In this example the value being passed to Header and Profile is [user, setUser]. When Header calls the context this is what it looks like: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HRNfNkvl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2a48lm1kyr03506rga61.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HRNfNkvl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2a48lm1kyr03506rga61.png" alt="Header calling useContext hook" width="440" height="101"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Profile component looks similar: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kTOcPSUf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/phfxe0xmucuaxsd4mx4z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kTOcPSUf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/phfxe0xmucuaxsd4mx4z.png" alt="Profile calling useContext hook" width="417" height="115"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So recap our steps:&lt;br&gt;
 1.) We created a context using the createContext method.&lt;br&gt;
 2.) We then took that created context and created a provider to wrap around our components.&lt;br&gt;
 3.) In the that provider we created and defined a value prop that could be passed down.&lt;br&gt;
4.) Lastly we called that value within our components, that had previously been wrapped by the provider, using the useContext hook.&lt;/p&gt;

&lt;p&gt;The end result of the UserContext example is:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iA5ceHr---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x28khdjy90qercvdsmby.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iA5ceHr---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x28khdjy90qercvdsmby.png" alt="Header and Profile" width="800" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sBNuX5Ae--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fo4tt67l6nnt8tjp4xz9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sBNuX5Ae--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fo4tt67l6nnt8tjp4xz9.png" alt="Header Profile and Interests" width="800" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As for the Music Player:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WLkCS1lY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9qm3atieutx0v32cs158.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WLkCS1lY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9qm3atieutx0v32cs158.png" alt="Music plays on Explore" width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LdEQwZFw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vl2z7dkw03a5xuvi6s6w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LdEQwZFw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vl2z7dkw03a5xuvi6s6w.png" alt="Music plays on Home" width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The MusicPlayer was able to continuously play the song, uninterrupted, as I moved from the Explore page to the Home page. &lt;/p&gt;




&lt;p&gt;Sources:&lt;br&gt;
Barger, Reed. "React Context for Beginners – The Complete Guide (2021)". Posted 21 July 2021. Retrieved from &lt;a href="https://www.freecodecamp.org/news/react-context-for-beginners/"&gt;https://www.freecodecamp.org/news/react-context-for-beginners/&lt;/a&gt; on 6 December 2023.&lt;br&gt;
"React Context". Flatiron School/GitHub. Retrieved from &lt;a href="https://learning.flatironschool.com/courses/7022/pages/react-context?module_item_id=624604"&gt;https://learning.flatironschool.com/courses/7022/pages/react-context?module_item_id=624604&lt;/a&gt; and &lt;a href="https://github.com/learn-co-curriculum/react-hooks-use-context"&gt;https://github.com/learn-co-curriculum/react-hooks-use-context&lt;/a&gt; November 2023.&lt;/p&gt;

</description>
      <category>react</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Understanding the Difference Between Parameter and Argument</title>
      <dc:creator>AnneMiriam</dc:creator>
      <pubDate>Mon, 13 Nov 2023 05:11:52 +0000</pubDate>
      <link>https://forem.com/annemiriam/understanding-the-difference-between-parameter-and-argument-4ijb</link>
      <guid>https://forem.com/annemiriam/understanding-the-difference-between-parameter-and-argument-4ijb</guid>
      <description>&lt;p&gt;I know that a lot of people have probably done this topic before me, but for the longest time it still didn't click. And I see others struggle with this all the time. So, I thought that perhaps I'd try to explain it in the way that made sense to me.&lt;/p&gt;

&lt;p&gt;So what is the confusion about? Well, the confusion lies &lt;br&gt;
in the fact that Parameters frequently get called Arguments! But they are not the same thing. So, what is the difference? Lets define them!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is a Parameter?&lt;/strong&gt;&lt;br&gt;
Parameters are a part of your Function! They are the words that go inside your function's parenthesis( )! They are the &lt;strong&gt;names&lt;/strong&gt; listed in the functions definition.&lt;/p&gt;

&lt;p&gt;Function Declaration ex:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---rtaITtC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/av8me0t8j4t4xqsobkir.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---rtaITtC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/av8me0t8j4t4xqsobkir.png" alt="function declaration" width="656" height="102"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Function Expression ex:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uNpDee5X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lhljvw3rcqrl0mdycthi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uNpDee5X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lhljvw3rcqrl0mdycthi.png" alt="function expression" width="582" height="100"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some functions call for multiple parameters that are separated by comma's.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hhx70k-o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xdfioj5ilb86vljcqy47.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hhx70k-o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xdfioj5ilb86vljcqy47.png" alt="multi-parameter function" width="722" height="104"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are some things to keep in mind about Parameters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;parameters don't specify data type&lt;/li&gt;
&lt;li&gt;parameters can be undefined&lt;/li&gt;
&lt;li&gt;parameters can hold a default value&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ex: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2KGbRJE4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f36877hjhku54ozcz3jj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2KGbRJE4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f36877hjhku54ozcz3jj.png" alt="default value declared" width="502" height="96"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;this way, if b is not passed in the argument 
or is undefined, b will equal 2 &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ex: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Y2rD1FW4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l216qa2bsonfu3ab9fl3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y2rD1FW4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l216qa2bsonfu3ab9fl3.png" alt="answer to above" width="260" height="92"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most Important to remember:&lt;br&gt;
A parameter is a &lt;strong&gt;placeholder&lt;/strong&gt; and has no real value! A parameter can be named anything. It is recommended, however, that when you name a parameter, you give it a name that refers to the information it will be taking in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is an Argument?&lt;/strong&gt;&lt;br&gt;
Arguments in this discussion are a value used to help invoke the function. It also goes inside the parenthesis ( ). There is a lot more to arguments, but right now I'm focusing on how it compares to the parameter.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9B9djQ3---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ty92tfavr0bx1g5wm5wu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9B9djQ3---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ty92tfavr0bx1g5wm5wu.png" alt="Arg vs Param" width="690" height="124"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Unlike the parameter, the argument receives an actual value. We then pass the assigned value of the argument into the parameter's variable placeholder.&lt;br&gt;
Some extra things about arguments&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;arguments are data types

&lt;ul&gt;
&lt;li&gt;they can be a string, a boolean, a number&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;arguments can also be variables&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XbAEJZwn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1r9c5aontq53i5y48mzd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XbAEJZwn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1r9c5aontq53i5y48mzd.png" alt="variable arguments" width="800" height="277"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;arguments can also take expressions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dorxgPts--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qvo6jd9gen1yml4jpamu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dorxgPts--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qvo6jd9gen1yml4jpamu.png" alt="argument expression" width="800" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Last note:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A parameter is only defined once, at the time of function declaration. &lt;/li&gt;
&lt;li&gt;An argument may be defined multiple times, meaning it may change each time the function is called.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope this helped for some more people, who like me struggled to make sense of the difference between parameters and arguments. &lt;/p&gt;

&lt;p&gt;To leave you: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KlUaVs6M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ozcrzgqav706x2j9wglz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KlUaVs6M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ozcrzgqav706x2j9wglz.png" alt="animalGreeting" width="800" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hOv8dM2n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19jgfb9rsvwqgdj8v36e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hOv8dM2n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19jgfb9rsvwqgdj8v36e.png" alt="Tedward" width="686" height="82"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;| |&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9uqDkMki--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eta6lrfiuw6vmwu9mqrp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9uqDkMki--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eta6lrfiuw6vmwu9mqrp.png" alt="Tequila" width="712" height="80"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_OHlJUyc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p232wg11j5humgzwg3ax.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_OHlJUyc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p232wg11j5humgzwg3ax.png" alt="Tequila the Chihuahua" width="380" height="335"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sources:&lt;br&gt;
Freeman, Eric, and Elisabeth Robson. &lt;em&gt;Head First JavaScript Programming: A Brain Friendly Guide.&lt;/em&gt; O'Reilly, 2014.&lt;br&gt;
'JavaScript FunctionParameters.'&lt;em&gt;W3Schools.com&lt;/em&gt;, Retrieved 9 November 2023 from (&lt;a href="https://www.w3schools.com/js/js_function_parameters.asp"&gt;https://www.w3schools.com/js/js_function_parameters.asp&lt;/a&gt;)&lt;br&gt;
Mustafeez, A. Z.'Parameter vs. argument'. educative.io. Retrieved 9 November 2023 from (&lt;a href="https://www.educative.io/answers/parameter-vs-argument"&gt;https://www.educative.io/answers/parameter-vs-argument&lt;/a&gt;) &lt;/p&gt;

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