I knew going in that my CLI project would be challenging. It’s sort of like the middle challenge in each episode of The Great British Bake Off. In this challenge the bakers are given a pared back version of a recipe. Instead of telling the bakers how to make a sponge cake with icing, the recipe just says, “make sponge and cover with icing.” No ingredients, no bake time, no instructions on how to put the icing on. Bakers are then judged on how well you can recreate the cake.
Make a CLI. It should go one level deep. Off you go.
So, I started off getting my gem set up with bundler and felt good about that and I watched some videos and decided that coding from the outside in made the most sense to me. In my bin folder I created a file called rugby-games that creates a new CLI object and runs the call method on it. and then moved on to coding the CLI object itself with hard coded or “fake data” to make just that was working. I continued on that course with fake data to my other object that creates games from fake data scraped off ESPN. I felt great about this project.
As long as the data was fake I had a great project but then came the scraping. And the website I decided to use was the ginormous table. I had to try a lot of Regex because a lot of the data I was trying to pull had an annoying abbreviation attribute that added a 3 letter abbreviation to every team name. I had other problems as well, I could scrape an entire list of teams but how was I going to create a name for my Games object from a giant array? I had at one point thought of using the match up website of each game to getting additional information for my 1 level deep but that wasn’t working either. And I was just throwing a lot of stuff at the wall hoping it would become a project. It was the low of lows.
But then I was reminded of a good piece of advice from Paul Hollywood while watching the Great British Bake Off to unwind.
And once I started to spend shorter amounts of times focusing on specific problems instead of bouncing from problem to problem things started to come together. Like a perfect sponge cake with icing. At the end of this experience I am very proud of myself for sticking with it. I have also learned so much not just about coding but about myself as well. No matter what happens in my review I’m on a high from this accomplishment.