Submitted over 3 years ago
(6:15pm - 9:34pm)
Here are other times I've coded since my last post:
* 6/25/18 1:30pm - 2:20pm
* 6/26/18 7:27pm - 9:20pm
* 6/27/18 1:10pm - 2:40pm
* 6/28/18 5pm - 6pm & 8:45pm - 10:07pm
* 6/29/18 1:23pm - 2:05pm
* Successfully retry geolocation request if valid weather data isn't entered.
* Fix 'more please' command so that it works recursively.
* Add additional weather request options.
* Add color to program-generated text to differentiate from user-generated text
* I'm at 43.72% complete on the 144HoursOfCode challenge, just a little bit ahead schedule.
I've been super busy (had a chicken 🐔 emergency) and have had a hard time finding time to code and definitely to update lately. I've still been making coding time happen, and glad that I'm finally able to make a blog post now. Pretty much this whole time, I've been stuck on what I thought would be a straightforward problem that has truly thrown me for a loop and honestly has been making me feel bummed out and incompetent. The problem was throwing an error message and retrying the function that gets that latitude and longitude data based on the city and state that the user input. And today, I finally got it working! I used this third-party package to make that retry: https://github.com/matryer/try
Originally, I'd been performing the retry from within the call that gets the latitude and longitude data. But as soon as the inner function returned the correct response based on a new user input, the outer function returned an incorrect response based on the original incorrect data. I retried setting all the relevant variables back to empty before the second request both within and outside of the retry function, but it didn't fix things. I asked for help on a golang Slack after several hours of working on the retry from within the function, and they suggested handling the logic outside of the function making the call for latitude and longitude data. Based on that advice, I tried creating a separate function that would handle the retry based on this article and worked on that for a few hours, but I couldn't get it to work. Today, I tried out the try package & got it working fairly quickly (relative to the amount of time I've already spent on this problem).
Since I got that fixed up, I was able to move on to other issues like fixing the 'more please' function so that users could request more location data after their original request (it needed to be recursive), adding different kinds of weather options (fairly straightforward but more exciting than error handling), & adding color to the program-generated text so that users could differentiate it from the text they entered. This one also required a separate package but it required several searches and a few different tries to get it right. The first one I tried caused errors with the output from the DarkSky API, the second didn't work at all, and the last one, aurora is the one I got working.
Next up, these are the tasks I can choose from:
* add detailed documentation to the readmes for my portfolio projects describing what they do and how to implement them
* refactor Pegacorn Project - I'm thinking that each of the separate files should go into separate functions in the same file, but I need to check that out
* add tests to each of my portfolio projects
* start on flashcards app
* add more functionality to Poncho project
Here are today's commits:
And here are the commits since I've last made a blog post (not too many here because there wasn't too much progress to log):