<?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 Sean S on Medium]]></title>
        <description><![CDATA[Stories by Sean S on Medium]]></description>
        <link>https://medium.com/@sps4462?source=rss-38a87c86934f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Sean S on Medium</title>
            <link>https://medium.com/@sps4462?source=rss-38a87c86934f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 07:02:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sps4462/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[Using Ruby to Help Your Frontend]]></title>
            <link>https://medium.com/@sps4462/using-ruby-to-help-your-frontend-6baf49913cb7?source=rss-38a87c86934f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6baf49913cb7</guid>
            <dc:creator><![CDATA[Sean S]]></dc:creator>
            <pubDate>Sun, 16 Apr 2023 23:25:30 GMT</pubDate>
            <atom:updated>2023-04-16T23:25:30.048Z</atom:updated>
            <content:encoded><![CDATA[<p>Progressing through the learning process of full stack development has been a true journey, both frustrating and rewarding. For someone who started with no coding background it can be even more daunting. However, programming languages were not handed to us from some higher beings, even though sometimes it may seem that way. They were created by programmers, real people.</p><p>Ruby has a reputation as being a programmer’s language. A language built for the pleasure of coders. I find this aspect to be true, especially when I switch back and forth between frontend and backend development. There are just some things that are much easier and more intuitive to program in Ruby as opposed to Javascript or React.</p><p>During my first foray into building an integrated application incorporating a Ruby backend with a React frontend, I found the ease with which Ruby can manipulate database information very helpful. In particular, I found it easier to manipulate the database information with Ruby rather than simply fetching all the data on the frontend and storing it in state.</p><p>For instance, let’s say we have an application that tracks exercise personal records. A user can input various exercises and record their personal records and the date they achieved them.</p><p>A sample of a user’s personal records may look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u6Y1a_Iz0lyCL0FOYWKFlQ.png" /></figure><p>This is great information that you can easily fetch from your frontend and store in state to render in the DOM.</p><p>A simple Ruby get route would then look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mFuaop-_52AXjgn128xNVQ.png" /></figure><p>Which you could easily render like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hds7rOWWtwuzFPfC1On5NA.png" /></figure><p>Initially, the exercises are grouped together and ordered by date because of where they are in the database.</p><p>But what happens if the user decides to update an older personal record instead of adding a new one? In this case, more recent personal achievements may stay buried down the list.</p><p>And now your records render like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rgCH5KLPWuJqLfy1q9xT2Q.png" /></figure><p>Here, you can see that the user updated a deadlift and squat personal record and date but it is not apparent that these achievements are now the most recent.</p><p>To filter this nested array of data by date in the frontend would require several steps and may be more complicated than you want to deal with. Fortunately, the ease with which Ruby can interact with this data on the backend makes the choice about where to order the data simple.</p><p>It only takes a very small addition to your initial get route code to send the data to your frontend in the proper order.</p><p>A small change to the code is below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5tUYPvg1JehXeX5cCi3O9g.png" /></figure><p>As you can see, all we did was chain Ruby’s order() method to order the personal records dataset by the date in descending order. This will send the data to the front end with the most recent achievements in the beginning.</p><p>Now when you render a user’s personal records, they will already be sorted by date.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nbt4nl3zEXymVPPqN5JNzA.png" /></figure><p>And if the user again decides to update an old record rather than create a new one, the most recent records will still render at the top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*upPkXo3lORtmBiQpjnD3nQ.png" /></figure><p>Of course, the user would probably enjoy being able to easily compare apples to apples by having all the exercises grouped by type and ordered by date. In this case, since you’ve already ordered the data by date on the backend before you send it to the frontend, filtering is a much simpler process in React. It is much easier to add exercise and category filters for rendering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WHjiDgQxyknchFM0s4Byng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2V3IOUTgxurcccZv_JuVnw.png" /></figure><p>In summary, working with frontend and backend frameworks takes time to learn. It is a process. For some of us, it is a long and difficult process.</p><p>However, whether your frontend language is React and your backend language is Ruby, or some other combination of languages, the key thing to remember is that each part of your application framework has strengths and weaknesses. One aspect of coding my be vastly more simple in your backend versus your frontend, or vice versa.</p><p>To make the best use of your chosen framework means doing the work where the work makes the most sense. In my case, it was learning to use the ability of Ruby to interact with databases and send more refined data to the frontend versus constantly trying to manipulate the data from just the frontend.</p><p>I certainly look forward to expanding my knowledge base and ability to work on both the frontend and backend of applications. If nothing else, this learning process has taught me the value of understanding the why behind a particular language and not just the how.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6baf49913cb7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developer Notes, Not Just For “Others”]]></title>
            <link>https://medium.com/@sps4462/developer-notes-not-just-for-others-455ef8e0af92?source=rss-38a87c86934f------2</link>
            <guid isPermaLink="false">https://medium.com/p/455ef8e0af92</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Sean S]]></dc:creator>
            <pubDate>Sun, 04 Sep 2022 22:43:49 GMT</pubDate>
            <atom:updated>2022-09-04T22:43:49.614Z</atom:updated>
            <content:encoded><![CDATA[<p>Using Developer Notes to Keep Yourself On Track and Time Efficient</p><p>As I move further along this coding journey I find myself consciously looking back to acknowledge how far I’ve come. Too often, we don’t realize how much progress we’ve actually made because the change is too subtle on a daily basis. But it all adds up to big transformations if we just step back and look at the whole. And taking the time to periodically give yourself a little pat on the back is a nice self-motivator.</p><p>When I began learning to code a few short months ago I really had no practical experience. Other than a class in Pascal and a Geocities site with friends in high school (which might as well have been in a different lifetime), I started from zero. So to look back on what I’ve learned in JavaScript and React is satisfyingly impressive to me.</p><p>I like to let myself struggle through my school’s curriculum because I find I gain a stronger, more lasting knowledge if I work issues out on my own rather than finding code someone else has done. However, after I’ve made a working solution I like to see what efficiencies are available.</p><p>One problem I’ve recently implemented my own solution for is developer notes. I tend to code in marathon sessions. I get on a roll, and before I know it, I’ve missed meals and it’s approaching morning. I don’t particularly like to work on code when I have less than hour.</p><p>But an hour is a lot of time. I got to thinking, why don’t I like coding when I only have less than an hour? And the answer is it takes too long to figure out where I left off, what I was doing, which components pass which props where, and what the next piece of code was I meant to write. By the time I’m all warmed up and ready to start, I’ve gone through too much time to make new coding worth the rest of my time. In my house, time is precious.</p><p>So here are a few steps I incorporate into my coding that make picking up where I left off a quick and easy process.</p><p>Step 1: Keep an Accurate and Updated Component Hierarchy</p><p>When learning to write single-page applications in React that only have three or four components, it’s relatively simple to figure out in your head what the component hierarchy is. But as the application becomes more complicated, and you have more components to manage, it quickly becomes much more difficult to keep a correct component hierarchy in your head.</p><p>Whether in your Readme file or in your top-level component, do yourself a favor and always include some representation of your component hierarchy, even for small applications.</p><p>It can be as simple as this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*cKBW7mZJWHYiKzetAq8iXQ.png" /></figure><p>Or more complex:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*IpAeZyQ4IABSGRX_Flj0_g.png" /></figure><p>Certainly you can move through the components and determine which components are dependent on each other by reading the imports, but to see it visually in one spot saves time when trying to figure out how to structure a new component or where to park or pass props.</p><p>Step 2: Add More Descriptive Notes Inside Your Components</p><p>The main reason I started adding more developer notes for myself was because I’d have to spend too much time trying to remember where I was going with this function or that, or which process was feeding what. While descriptively naming your functions and variables should be a standard we all live by, inevitably there may be several “handleDelete” or “handleLike” functions throughout your application that make things confusing. Even if you super-personalize every function and variable, the naming convention can only be so long, and it’s not as good as a plain old developer note.</p><p>Here we have a short piece of code that would be relatively easy to figure out what is supposed to be happening:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4zOBh5vlffzi1g7o7-0vJg.png" /></figure><p>When the component renders it should reset the CurrentUser to an empty string. Then, when the user enters their name in the form, the information is captured. And when they submit their info, their userName is set and they are redirected to the home page.</p><p>But imagine scenarios (which are less easily depicted in a tight screen) where your functions are much more spread out or depend on many more variables or conduct much more complicated work. Wouldn’t you be thankful if you had just written a few extra descriptive words? Like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EQLMJxssgE3050RADT_oyg.png" /></figure><p>Step 3: Maintain a To-Do List</p><p>When I sketch out a new application I list the functionality I would like to incorporate: post comments, like a post, delete a post, edit a post, add images, etc. Once I’ve got a good starting point, I prioritize that list in the order in which I want to work on them. And as I complete tasks, I remove them from the list, or as I think of additional tasks, I add those to the list. Again, you can keep this list wherever you like. While in pre-deployment, I just keep it below my component hierarchy chart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xEZ1xwpHTD4-tIeGTkgH6g.png" /></figure><p>This way, I always know where I am in my work and where I need to go next. If I have to, I break down the list into even smaller parts and just chip away at the project. There is a whole science behind the efficacy and psychology of lists, but if you keep a concise, prioritized list and work your way through it, you’ll be at the end of your project before you know it.</p><p>With these three simply steps, I’ve been able to dramatically shorten the amount of time it takes me to sit down, take stock of where I’m at, remind myself of where I need to go next, and start working.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=455ef8e0af92" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Little Checks Matter]]></title>
            <link>https://medium.com/@sps4462/the-little-checks-matter-ce4bd0b6763e?source=rss-38a87c86934f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce4bd0b6763e</guid>
            <category><![CDATA[console-log]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Sean S]]></dc:creator>
            <pubDate>Thu, 02 Jun 2022 09:52:39 GMT</pubDate>
            <atom:updated>2022-06-02T09:52:39.363Z</atom:updated>
            <content:encoded><![CDATA[<p>Using the console.log() method to work through JavaScript code… for newbies like me</p><p>Anyone familiar with coding will be able to tell this is my first blog on the subject. It’s also my first blog ever. I am brand new to learning JavaScript (JS) and do not ‘know’ any other computer programming languages. This first blog on my journey to earning the descriptor “software engineer” is all about the things I found useful as a newbie trying to get code to execute properly and return the desired output. I may look back on this blog with a cringe as I progress through my new career, but what mattered as I wrote this was learning effective processes to solving my coding problems (and keeping my hair).</p><p>Everything about a coding bootcamp is drinking from the firehose, especially for those with no prior experience. Besides constantly referencing the Mozilla Developer Network (MDN), the most valuable tool for me was the process of using the console.log() method to check my work, and find and fix errors.</p><p>I noticed it more and more while watching online lab demos and the ways in which instructors used the console.log() method. They not only used it to demonstrate what the commands were telling the computer to do, but also to diagnose problems and fix them.</p><p>Being new, I don’t know if there are better or more efficient ways to work through coding errors, but I know this works for me. Maybe as I become more experienced, I will start using more sophisticated tools. There were lessons on using the debugger in the console, but my overloaded brain felt more comfortable with the console.log().</p><p>So for example, I console.log() in baby steps. For almost every function I write, I console.log() multiple times, especially when grabbing something, or passing data.</p><p>Instead of writing complete blocks and checking at the end:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F-dDjNpRValUeN_ad2uEnQ.png" /></figure><p>I go in increments:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yr6Y5QP6BZ_4dxZolpPytg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZYGMEBjgkCuoeZz0WV3hgQ.png" /></figure><p>This last step will hopefully return my data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*6GhdoT37W7k6PrzSU8wbWQ.png" /></figure><p>Now that I am fetching the data I want, I need to pass that data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oICCpKcNPeVoGev9AnI9ZA.png" /></figure><p>I initially name some future functions and start to build those, checking my work incrementally:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PzI2Fx_vt7e_k8NmJfTxLQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*QIITSURsujdIcnrkqBTzPQ.png" /></figure><p>Once I’m happy I correctly passed the data to the next function and can continue:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I-D3btZr28d9ZqGEKwDrSg.png" /></figure><p>Which gives me the correct output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*U_J6wg7PRHNXU54F5CqYFw.png" /></figure><p>Going back to the original event listener, I can continue with the next function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cLPD4_NXHLTXlnWl1xk0Aw.png" /></figure><p>Like so…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ducGp-UJUqEKIgwpQtvgAg.png" /></figure><p>Still correct?…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*vuMRUrKdvJNN25WO8RV_2A.png" /></figure><p>Yep. Then the next step:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-V1mTIaPIIp2CHaqTiS5aA.png" /></figure><p>And so on and so on. This way I check and verify that I’m moving in the right direction with small enough steps that if I make a mistake I know exactly where I made it.</p><p>I have found this approach to take some extra time, but the peace of mind you get with each little win and never getting completely off track outweighs the cost in extra time. Usually, the few times I write longer blocks of code before checking my work, I spend more time combing back through it trying to find where I made the mistake that through me off track in the first place.</p><p>I especially find this approach invaluable when grabbing DOM elements like buttons. Given the following code, which is part of a recipe application, this block clears the user’s visible recipes to reset their view:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F-SkFolQr38P-7lEsYYcfQ.png" /></figure><p>I can see that output is the recipe section with all the recipes as their own div underneath (aka children).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*muI_4QJCIWoM2z5VHZmQJg.png" /></figure><p>So, to clear them from the DOM I should be able to repeatedly remove the next child until there are no more children. Let’s try:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ja7ejxGMmSJchVOtsUE4LQ.png" /></figure><p>And?…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*9ziIovG0edT7lUsjgmr3CA.png" /></figure><p>Perfect! I now have the empty section with no recipe children… all made easier with console.log() checks.</p><p>And it works great when trying to grab more complicated elements. Take this for example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m4CnDkH4o7-9OL6ywtzTRg.png" /></figure><p>How did I figure out this was the right element to grab and modify? A whole lot of digging and testing with console.log().</p><p>Writing and baby-stepping through code is one thing. <em>Fixing</em> code is a whole other thing. Fortunately, we can use console.log() in the same manner. Just start logging and read the results.</p><p>Here, my filter isn’t working. Of course, when building the function I stepped through it slowly, checking my work. But as the application grows, things change, and sometimes when you used to grab the right thing, you find you no longer are. So, this doesn’t work anymore:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZZ4x3wjxRvFYd3fo_uBIzg.png" /></figure><p>When I try to filter by the ‘main’ category I get nothing, in the console or the DOM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*8kR0iMs2VxYHA0pPfDJVbA.png" /></figure><p>Let’s pick a start location. How about the event (with a console.log)?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WtfEidDZ7gDW4OmyFCF2cA.png" /></figure><p>Result…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*vJ5BgHz8SG6-3CzYoyJyGA.png" /></figure><p>Great. I’m correctly capturing the event. Now I just need to find the element I need. If I drill down into the event, I find the event target is an array, in which the first element is my array of options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*w2Pr178L5R0tGziHah_-Bw.png" /></figure><p>I make my log a little more specific and see if that works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XKKx1cMhXBwJy6AZLhCnbQ.png" /></figure><p>Result…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*tUycEg28Rguhwu8yDadeqw.png" /></figure><p>Got it! Now I know I need to grab the value for my function to work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Let_-eq2lt1suiaY7nHnpQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*iLioNmXtmUrJE8szNVpeAw.png" /></figure><p>Success!</p><p>One downside to using console.log()? You quickly end up with console.log()s <em>everywhere</em>! It can make things even more confusing. Three strategies:</p><p>1. Use them in a targeted manner, not like a shotgun. A few, well-placed console.log()s are better than one every other line of code.</p><p>2. Label the output. A simple descriptive text string in front of the output can help remind you what you’re logging:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BjAC1CfbjFIIEJ57sjGeQQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*q2RYx-8MHQJcsSzJYSAakg.png" /></figure><p>3. Don’t forget to take them back out after they’ve served their purpose. Luckily, if you forget, the console will remind you exactly where they’re hiding (see above: indes.js:198).</p><p>And that’s it. Hopefully, a newbie like me will find this useful and I will continue to develop my writing and problem-solving skills. In time, this method may serve less utility as my skills progress, but right now I’m grateful to have a reliable process to work with.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce4bd0b6763e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>