<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Samantha Phipps on Medium]]></title>
        <description><![CDATA[Stories by Samantha Phipps on Medium]]></description>
        <link>https://medium.com/@sammi.phipps?source=rss-d9f405188251------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*arP7uAxLv1QzbIUv.jpg</url>
            <title>Stories by Samantha Phipps on Medium</title>
            <link>https://medium.com/@sammi.phipps?source=rss-d9f405188251------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 21:44:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sammi.phipps/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Error Handling with React]]></title>
            <link>https://medium.com/@sammi.phipps/error-handling-with-react-98855ccc4420?source=rss-d9f405188251------2</link>
            <guid isPermaLink="false">https://medium.com/p/98855ccc4420</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[error-handling]]></category>
            <dc:creator><![CDATA[Samantha Phipps]]></dc:creator>
            <pubDate>Mon, 02 Mar 2020 02:06:13 GMT</pubDate>
            <atom:updated>2020-03-02T02:06:13.374Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*PrjfRG4x5vIYvgBL2oLmXQ.jpeg" /></figure><p>Error handling is an important part of being a developer. After all, an application shouldn’t break due to something that could easily have been predicted. With React, there are 2 different lifecycle methods available to take care of errors. But, these lifecycle methods need to be used in a specific way.</p><p>One method that is available with React is componentDidCatch. This method can be invoked when a descendant component throws an error after the parent component renders. According to the React documents, it is recommend that componentDidCatch be used mostly for logging errors.</p><p>The other lifecycle method React built for error handling is getDerivedState. Like the componentDidCatch method, the getDerivedState method will only be invoked when a descendant component throws an error. However, unlike componentDidCatch, this method will be called while the parent component is being rendered and will update the state upon a value being returned. This means that if the developer uses this method for error handling, they will need to include a property value for errors and take it into consideration when rendering the component.</p><p>Notice that one thing both methods have in common is that the error will only be thrown due to something happening in a descendent component. This poses a problem if the developer needs to take an error into account on the same component that is throwing it. In this type of situation, neither of the lifecycle methods mentioned will work. Instead, the developer will need to figure out which of the properties is causing the error and take it into consideration when rendering the component.</p><p>Overall, there are not very many ways to handle errors within React. Currently, there are 2 lifecycle methods that can be invoked if an error occurs. The only other way is to manually find and take into account errors when rendering components. This may change in the future. However, for now these are the only available options for handling errors.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98855ccc4420" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reasons to Use Language Specific Dev Tools]]></title>
            <link>https://medium.com/@sammi.phipps/reasons-to-use-language-specific-dev-tools-59253d96770c?source=rss-d9f405188251------2</link>
            <guid isPermaLink="false">https://medium.com/p/59253d96770c</guid>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[chrome-extension]]></category>
            <dc:creator><![CDATA[Samantha Phipps]]></dc:creator>
            <pubDate>Wed, 08 Jan 2020 22:29:43 GMT</pubDate>
            <atom:updated>2020-01-08T22:29:43.347Z</atom:updated>
            <content:encoded><![CDATA[<p>When learning a new programming language, one of the very first things that you should look into is what developing extensions are available. When programming in React, I found that my most powerful tools was the Components tab found in the React Develop Tool extension. The tab provided 3 things that became important to me when creating a project in React. The first thing it showed was what components were being displayed. When that component was clicked on it would also provide the state and props being generated. Finally, it also showed the different thing that rendered the component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cgtdzytYjXeqmbcItcoDtQ.png" /><figcaption>Display Components Functionality</figcaption></figure><p>Knowing what components are being displayed becomes important because it allowed me to follow along in my code. If I didn’t have this functionality, searching for the specific point when that component should appear would be like searching for a needle in a haystack. With this feature, I can immediately go the that component and make my updates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*clH0RFsvE2e2ck3BXkBOlQ.png" /><figcaption>Render By Functionality</figcaption></figure><p>Similarly, knowing when renders your components allows you to break down how information is being passed down. When working with a project, I sometimes found myself passing functions to change state in another component down a couple of different layers. By knowing the rendering path, I can immediate search through those components to update a function, rather than searching through all of the components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*boi9FlwMf1fkTRYJee3uIg.png" /><figcaption>State and Props Functionality</figcaption></figure><p>Both of these functions especially become important as your projects get bigger. One of the problems that I had with a recent project was that I had a lot of components within it being rendered, but I didn’t update my file structure as it was growing. These 2 functionalities helped me a lot with this problem, as I could sort through the relevant components to make my updates.</p><p>Probably the most important of the 3 features though, is knowing what state and props are. The reason this is so important is because information that is displayed on the component respond to what the state is and what is passed to it. Having the ability to double check the state and props allows you too easily ensure that functions to change state are doing exactly that, and that the correct information is being displayed. You also don’t need to clutter up your Console with console log trying to keep track of state.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59253d96770c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Appreciating Your Accomplishments]]></title>
            <link>https://medium.com/@sammi.phipps/appreciating-your-accomplishments-d9a6671fd155?source=rss-d9f405188251------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9a6671fd155</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Samantha Phipps]]></dc:creator>
            <pubDate>Fri, 20 Dec 2019 14:46:14 GMT</pubDate>
            <atom:updated>2019-12-20T14:46:14.313Z</atom:updated>
            <content:encoded><![CDATA[<p>Appreciating Your Accomplishments</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e7dVu3_KNuoaYAiwdptpCw.png" /><figcaption>Image from The Empowered Entrepreneur</figcaption></figure><p>Often times when doing a project from scratch, your dreams and expectations for that project exceed what you are able to present. However, just because it doesn’t do what you expected it to, doesn’t mean you shouldn’t be proud of your project. You can find below a list of some of the things to keep in mind when presenting your project.</p><p><em>1. Do you have something to present?</em></p><p>Probably the worst thing that could happen is having nothing to show for the amount of time that you have been working on the project. As long as you have something to show, you have made progress and can swing your presentation to have a positive message.</p><p><em>2. How much time did you have to work on your project?</em></p><p>We’re not able to work on a project forever. Often times we have deadlines for presentations or to show progress. This means that you may need to cut some of the features that will take a long time to do. Instead, you’ll be doing something that you know you can accomplish within your timeline. Only if there is time at the end, will you be able to move onto the next feature. This doesn’t mean that your project isn’t good, it just means that you didn’t have the time to get everything that you wanted to get done. This leads to my next point.</p><p><em>3. You can always add features to your projects at a later date.</em></p><p>Just because you presented your project, doesn’t mean that it needs to end there. It can be just the beginning of it. Part of being a programmer is practicing and working on something to keep up your skill. Having a project that you are constantly working on and improving shows to people that you enjoy what you are doing and are passionate about it. Also, even if you think you are finished with something, you can always get feedback from someone and then go back and improve it even more.</p><p><em>4. Is there some cool feature that you implemented in your project</em></p><p>Speaking of features, part of the reason you might not able to do everything could be because you got stuck working on some cool feature that you implemented. These features can be very complicated and require lots of time puzzling out the best way to code them. Then you need to test it out to ensure that it works the way you want it to. If it is not that means going to the drawing board and figuring out what worked and what didn’t. You could also be reaching out to other people to get help on it. This doesn’t mean that it is a waste of time. Instead, think of it as getting a new skill and having the knowledge on how to implement that feature and anything similar to it on another project.</p><p><em>5. Did you have to learn a new technology?</em></p><p>If you learned a new technology to use in your project, that is something to be proud of. Part of the reason why you wouldn’t be able to finish everything is because you are trying to understand something that you have not been shown yet. In order to be able to use that language, you will need to take time to look up videos, tutorials and doing simple exercises to understand the code. You’ll also be looking up any issues that come up. All of this takes time away from working on your project. However, you now have a new skill and you’ll be able to spend more time doing what you want with that language. You’re actually ahead of the game.</p><p><em>6. Are you doing a continuous project?</em></p><p>Something that I mentioned early was that what you are presenting could be just a portion of a project that you are working continuously on or will not be completed for a long time. In this case, just remember that you have not actually completed the project and are just showing the progress that you have made. Instead, think of it as being one step closer to the finish line.</p><p>Even if your project doesn’t have any of these incorporated in it, always just appreciate how far you have come. Think back to a time when you were not even able to code. What are all of the things that you now know how to do compared to back then. Sure you might not have been able to complete everything on your project, but you sure have learned a lot in the process of doing it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9a6671fd155" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When to Position Code within a .Then Chain]]></title>
            <link>https://medium.com/@sammi.phipps/when-to-position-code-within-a-then-chain-df9f0378e360?source=rss-d9f405188251------2</link>
            <guid isPermaLink="false">https://medium.com/p/df9f0378e360</guid>
            <category><![CDATA[fetch-calls]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Samantha Phipps]]></dc:creator>
            <pubDate>Wed, 20 Nov 2019 06:25:46 GMT</pubDate>
            <atom:updated>2019-11-20T15:52:59.815Z</atom:updated>
            <content:encoded><![CDATA[<h3>When to Position Code within a .Then Chain</h3><p>One of the most important things that I have learned when working with fetch is knowing when code needs to be placed within the .then chain and when it doesn’t. A fetch is essentially a promise, which means that it will eventually return a value that can be acted upon. You can find below an example of what the fetch method should look like. The way it is structured is that the fetch method will request a response from the URL provided. Once that response is passed back to the client, it then needs to be parsed into a json format. This is due to the fact that the internet will only send back data in a string format. Only after the data has been put into a json format, can it be acted upon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*HhQAtseNxFt5SZhBmTW1yg.png" /><figcaption>Structure for a Fetch Call</figcaption></figure><p>Now within a web page, there are many moving parts. In the case of my project, I had a dropdown that was being populated with information from one database table in the backend, and a form that was being populated by another. Thinking about the code like this, it seems like 2 different fetch calls need to be used, that are not connected in any way. However, the form actually requires that the dropdown already be populated with its data. This way when its fetch call runs, it can set the dropdown to what it needs to be.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*L8jZCLF_kJcIsELceKULuQ.png" /><figcaption>Original Incorrect Positioning for my Projects Fetch Calls</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*JMPThwADP84nz9w-Z5H--w.png" /><figcaption>Correct Positioning for my Projects Fetch Calls</figcaption></figure><p>Because my project was originally structured the incorrect way, I ran into a couple of issues. One of the first issues to come up, was that the dropdown did not get set to the correct option. Instead, it defaulted to the first option that was populated into it. The second issue that came up, occurred when using console.log on the dropdown value to locate a problem. What would happen is that sometimes the dropdown value would appear in the console and sometimes it would disappear, when the page was refreshed. Finally, probably the biggest issue, was that when the form was submitted the dropdown value that was selected would not come through. Instead, it was blank. This was a big issue because without the value, data could not be created or updated in the backend.</p><p>All of these problems were caused by not having the code within the .then chain for the fetch call that populated the dropdown. My recommendation for those developers that don’t know if their code should be within the .then chain, is to ask yourself one question. Does anything in the code rely on what is happening to the data in the other fetch call? If so, try putting the code within that fetch’s .then chain and see if there are any problems. If the code doesn’t rely on the other fetch call, you can most likely put the code outside of the .then chain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df9f0378e360" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using a Hash to Get the ID of a User’s Selection]]></title>
            <link>https://medium.com/@sammi.phipps/using-a-hash-to-get-the-id-of-a-users-selection-fff8c7d8475c?source=rss-d9f405188251------2</link>
            <guid isPermaLink="false">https://medium.com/p/fff8c7d8475c</guid>
            <category><![CDATA[hash]]></category>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Samantha Phipps]]></dc:creator>
            <pubDate>Tue, 29 Oct 2019 03:51:18 GMT</pubDate>
            <atom:updated>2019-10-29T03:51:18.254Z</atom:updated>
            <content:encoded><![CDATA[<p>When working with a CLI application, there are some situations where the developer would like a unique value returned upon a user’s selection. This unique value would the different from what the user was shown. I recently had a situation like this in a project, where my partner and I had a character’s ID returned when that specific character was selected. We then used the ID to find the corresponding database entry.</p><p>The way that my partner and I chose to retrieve the ID was to create a hash, where the description was the key and the corresponding ID was it’s value. Once the hash was created, we then passed it to a select method within the tty-prompt ruby gem. By using the select method, the user would be shown a list of character description to chose from, but my partner and I would receive the value of the hash key selected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*aWV7jtdDLWoGgCB5PM5NRg.png" /><figcaption>Screenshot of Code Used to Create Hash</figcaption></figure><p>The screenshot above shows the helper method we used to create our hash. Since the goal of the method was to produce a single hash that contained all the information, my partner and I used the reduce method on the array of information passed to it. To ensure that an empty hash was created each time the method was called upon, we had to put Hash.new() in the initial value position. We then needed to provide 2 variables: the hash variable that everything would be pushed into, and the array_entry variable that contained the information within the array for that specific iteration.</p><p>Once the reduce method was set up, we then needed to specify how the hash should be arranged. For this, we said that each entry description would be used as a key and when called upon it would equal the corresponding ID. Finally, what would be returned when the reduce method finished going through all the array entries needed to be specified. To do this, the hash variable was placed at the end of the code block.</p><p>As I mentioned above, after the helper method was used, the created hash was then passed to a tty-prompt. Since the ID was returned, it allowed us to straight away grab the character entry stored in the database. You can find below a look at what each variable used in the initial screenshot returned, as well as an example of the ID being returned upon the selection of a character.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*uVg0EGevab6xGoOMW8JQeg.png" /><figcaption>Screenshot of the Values Returned</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fff8c7d8475c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>