Parker's Blog


Flatiron School Software Engineering

Hearthstone sortbyflavor Method

During my technical interview/API assessment I was tasked with changing my API to instead of sort alphabetically by name, sort alphabetically by the flavor text that the card has. The code I ended up writing will be linked below. The reason I wanted to have the binding pry is to see exactly what was happening and to ensure that I had the arranging the correct data. The method works by selecting the array of [all] and sorting it by the syntax in the following hash, setting the key and value, |a,b|, and labeling “a and b as” .flavor to select what I was going to be sorting. Having to research this on something not on an assignment was very insightful to me because it is very easy to use when asked, but to fully understand how to set the variables when freely coding had me stumped, and let me fully understand what I was doing when creating this. To test that the code was working, I inserted it into my display_card_name method, which was originally written as the first display_card name, and the second was written to incorporate the new method we created which returned the array in the correct order.

```
def self.sort_by_flavor self.all.sort { |a, b| a.flavor <=> b.flavor } # binding.pry end


Hearthstone CLI Project

This project has been hands down one of the most difficult things I have had to do in a LONG time. Originally I though that our labs were very vague and difficult follow, but it is also something to appreciate due to the need to learn on your own, but this project was on it’s own level of difficult. I struggled with this lab a lot due to a few determining factors that I will need to make sure to handle ahead of time for our next project. First, I could not get my local environment to work which at first I thought wouldn’t be too bad, but after putting in countless hours each day, and attempting to troubleshoot on my own to no avail, I reached out for help. It took two days for it to be figured out and on Friday I was finally ready to begin my project.


Why did I decide to get into Software Engineering?

I first had my interest in software engineering when I was about 19 years old. I always though it was interesting and I saw that it was a very booming industry and will be a necessity for the foreseeable future. On top of that, I have always been interested in computers in general since a very young age. I had put them together with my dad as a hobby growing up, and then got into coding a little bit in the Myspace days. This was very entry level but I did enjoy doing it so I took it upon myself to learn a little bit extra to have a little bit more than what the average user could do. Once I got into college, and saw the computer science courses I quickly realized that was going to be the right path for me.