<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sumei C Kom</title>
    <description>The latest articles on DEV Community by Sumei C Kom (@sumeikom).</description>
    <link>https://dev.to/sumeikom</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%2F584622%2F56bfd93d-da8f-474d-8d2a-442f6b7d8f7d.jpeg</url>
      <title>DEV Community: Sumei C Kom</title>
      <link>https://dev.to/sumeikom</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sumeikom"/>
    <language>en</language>
    <item>
      <title>Flatiron Phase 1 JavaScript Final Project: Animechan</title>
      <dc:creator>Sumei C Kom</dc:creator>
      <pubDate>Mon, 26 Jul 2021 01:53:36 +0000</pubDate>
      <link>https://dev.to/sumeikom/flatiron-phase-1-javascript-final-project-animechan-3c8m</link>
      <guid>https://dev.to/sumeikom/flatiron-phase-1-javascript-final-project-animechan-3c8m</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Phase 1 is coming to a close and we were tasked with our Javascript final project. For our final project, we were entrusted with creating a Javascript app that is HTML/CSS/JS frontend which accesses data from a public API or a locally hosted JSON server, runs entirely on a single page, and incorporates at least 3 separate event listeners. When brainstorming for what I wanted to create for this project I knew I wanted to do something a little nerdy. Maybe something that was related to Dungeons and Dragons or anime related. I searched for free APIs and came across a helpful website that contained all sorts of free APIs from animals, business, health, and so on. If you don’t know where to start, this link will give you a bunch of options that may help. &lt;br&gt;
&lt;a href="https://github.com/public-apis/public-apis"&gt;https://github.com/public-apis/public-apis&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Expressions and .filter&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In my project I wanted you to be able to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;generate a random anime quote&lt;/li&gt;
&lt;li&gt;be able to like/unlike it&lt;/li&gt;
&lt;li&gt;your liked quotes accumulated in a list that you could use for later&lt;/li&gt;
&lt;li&gt;be able to tell you if you already liked a quote and it was in your list. 
From my API I only wanted to pull the quote and the title of the anime it was from. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I was really excited, everything was going smoothly. My buttons worked and generated a new anime quote. My “Like This Quote” button pulled my liked quotes into a pretty array underneath. However, I ran into a serious issue, when liking however many quotes you liked, it created an array of those quotes but when you unlike those quotes it would not pull that quote out, thus the original array remained. This resulted in an array that kept being added to and not removing quotes you didn’t like. I had trouble figuring out how to fix this and asked my cohort leader. He said Boolean expressions were a possible solution to my problem, specifically !== and the callback function, Array.prototype.filter(). &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Tkkoiaax--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gk6rf17mqacllgbp5jbt.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Tkkoiaax--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gk6rf17mqacllgbp5jbt.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The strict inequality operator(!==) returns true if two values are not equal without performing type conversions. This is really important from a strict equality operator(===) which returns true if two values are equal without performing type conversions. Even if the values on both sides of the operator look similar (e.g., '42' === 42), the === operator will only return true if the data types also match. The === operator will not work here. This was the program’s way of determining what stayed in the new array. &lt;/p&gt;

&lt;p&gt;Array.prototype.filter() accepts one argument, a callback function that it will invoke with each element in the array. For each element passed to the callback, if the callback's return value is true, that element is copied into a new array. If the callback's return value is false, the element is filtered out. After iterating over every element in the collection .filter() returns the new array, my new list of only liked quotes. &lt;/p&gt;

&lt;p&gt;A good explanation with example: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;With these two together I created a function that checked if quotes were liked or not and returned a new array of only like quotes. This fixed my display issue and now my website works with removing and adding quotes! &lt;/p&gt;

&lt;p&gt;Thank you so much for taking your time to read my blog. I hope you learned from my mistakes or found a better way of coding. If you want to see the final project please check out:&lt;br&gt;
&lt;a href="https://github.com/sumeikom/animechan-quotes"&gt;https://github.com/sumeikom/animechan-quotes&lt;/a&gt; &lt;br&gt;
Thank you so much!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Phase 1 Blog: Mass Assignment and Metaprogramming saved my life. </title>
      <dc:creator>Sumei C Kom</dc:creator>
      <pubDate>Sun, 18 Apr 2021 13:39:28 +0000</pubDate>
      <link>https://dev.to/sumeikom/phase-1-blog-mass-assignment-and-metaprogramming-saved-my-life-31g4</link>
      <guid>https://dev.to/sumeikom/phase-1-blog-mass-assignment-and-metaprogramming-saved-my-life-31g4</guid>
      <description>&lt;p&gt;Phase 1 is coming to a close and we were tasked with our CLI final project. For our final project, we were entrusted with creating a CLI project from scratch by using an API or scraping. &lt;br&gt;
When brainstorming what I wanted to create for my project I knew I wanted to do something anime-related. I wanted to create a CLI application that could pull along the lines by character or by anime title. I spoke to my cohort lead and she recommended that I started with an API rather than scraping. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Finding my API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finding the perfect API was challenging. Many APIs were close to what I wanted but not quite. Some APIs were either too complicated or lacking in providing the kind of information that I needed. At first, I thought I found what I needed. I found the Jikan API, which was an open-source PHP &amp;amp; REST API for the “most active online anime + manga community and database.” It seemed like a great fit but when conducting further research about this API it seemed better suited for different languages like Javascript. This API was also too intimidating for me because there were so many features such as searching by anime, manga, season, user, club, history, etc. I decided against this API for this project but maybe I’ll tackle it for fun later.&lt;/p&gt;

&lt;p&gt;Finally, I found the perfect API for me, the Studio Ghibli API. It was still anime-related by cataloged the people, places, and things found in the worlds of Ghibli but also it allowed for the kind of project I wanted to make. I wanted to create a project where I provided the user with different lists and they can pick what they want to learn more about. This API fit exactly what I wanted to do because it had many endpoints and huge arrays full of details about Studio Ghibli. &lt;/p&gt;

&lt;p&gt;After finding the API I wanted to use it was time to start coding! Here are a couple of things I would like to talk about that I had to implement to reach my final project:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pushing Work to GitHub literally saved my life&lt;/li&gt;
&lt;li&gt;The holy grail that is Keyword Arguments and Mass Assignment&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Pushing Work to GitHub literally saved my life&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;When I began my project, my cohort lead showed me how to upload all of my work to GitHub. She talked about how this not only showed the progress of the many steps of building my CLI but it would come in handy if my code ever broke. This problem did happen to me and I was racking my brain trying to get my code to what it was before. I must have deleted something important by accident because no matter what I was doing my code refused to work. Luckily I remembered that I had my previous version on GitHub and I retraced my steps from there. After grabbing my old code from GitHub my code worked again! Honestly, I am still not 100% sure what went wrong but I’m really glad that I was able to get my project back up and running. It would have been a disaster and a waste of a week if I wasn’t able to restore my project. &lt;/p&gt;

&lt;p&gt;If you take anything from this blog is that you save all your hard work to GitHub and that you push frequently. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The holy grail that is Mass Assignment and Metaprogramming&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In my project I wanted you to be able to search by either film or by a specific character. These different classes had different variables that it needed to pull from its array. From my Film class, I only wanted to pull title, description, release_date, original_title, and director. For my Person class, I only wanted to pull a name, gender, age, eye color, and hair color. I could have hard-coded each class but that would become very tedious. After speaking to my cohort lead about it she suggested metaprogramming and mass assignment. &lt;/p&gt;

&lt;p&gt;Hard-coding is very tedious and very prone to breaking. At first my code looked like:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;@@all = []&lt;br&gt;
attr_accessor :name, :gender, :age, :eye_color, :hair_color&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;def initialize&lt;br&gt;
@name = name&lt;br&gt;
@gender = gender&lt;br&gt;
@age = age&lt;br&gt;
@eye_color = eye_color&lt;br&gt;
@hair_color = hair_color&lt;br&gt;
end&lt;br&gt;
@@all &amp;lt;&amp;lt; self&lt;br&gt;
End&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;But through the key/value pair, made my code much more flexible.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;def initialize(person_hash)&lt;br&gt;
        person_hash.each do |key, value| &lt;br&gt;
            self.send("#{key}=", value) if self.respond_to?("#{key}=") &lt;br&gt;
        end &lt;br&gt;
        save &lt;br&gt;
    end&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;By doing this, I did not have to write out every piece of information I wanted to pull from my API.&lt;/p&gt;

&lt;p&gt;Thank you so much for taking your time for reading my blog, I hope you learned from my mistakes or found a better way of coding. If you want to see the final project please check out:&lt;br&gt;
&lt;a href="https://github.com/sumeikom/CLI_Final_Project"&gt;https://github.com/sumeikom/CLI_Final_Project&lt;/a&gt; &lt;br&gt;
Thank you so much! &lt;/p&gt;

</description>
      <category>ruby</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Blog #1: Why did you decide to study Software Engineering?</title>
      <dc:creator>Sumei C Kom</dc:creator>
      <pubDate>Tue, 23 Feb 2021 06:52:48 +0000</pubDate>
      <link>https://dev.to/sumeikom/blog-1-why-did-you-decide-to-study-software-engineering-4abk</link>
      <guid>https://dev.to/sumeikom/blog-1-why-did-you-decide-to-study-software-engineering-4abk</guid>
      <description>&lt;p&gt;I decided to get into software engineering for a plethora of reasons. I am currently a part-time student at The University of North Carolina Greensboro, pursuing a bachelor's in Political Science. I would like to combine my two certifications to work for a political institution, a non-profit organization, or a think tank. Something that I have noticed is that there are many college graduates that are unable to find a job in their field after graduating. I hope by holding both degrees it will make me very appealing to the job market versus other fresh graduates. &lt;/p&gt;

&lt;p&gt;Another appealing aspect of software engineering is how broad it encompasses. It covers multiple industries such as nonprofit, health care, media, etc. There also seem to be many different types of fields available to explore through software engineering, such as creating webpages, debugging, and enhancing a company's network system. I like the idea of having so many options available to me. &lt;/p&gt;

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