Growing my Understanding

November 18th, 2019
growing-my-understanding

Getting more comfortable


As I stated yesterday, I've started taking a deep dive on everything in the Gatsby ecosystem. There isn't much in the way of content involving these technologies on Frontend Masters, so I've had to do some digging to find some good resources. Last night, I started a 4 hour course on GraphQL that went at a much more maintainable pace than Scott Moss' course on the same subject. This course, Shaun Pelling's "GraphQL Full Course - Novice to Expert" on Youtube, was centered on building a very simple app using MongoDB as a database, GraphQl, and React. I feel like I walked away understanding things on a much deeper level than I did with Scott Moss' course. It would have been really advantageous to watch that course and then watch Moss' course, as I think I would have gotten a lot more out of it.

During this course, I found myself trying to refactor class component into functional components and create hooks where state was used. It was incredibly easy and everything worked as it should have. He also had 2 really weirdly created components where he had an if/else function that rendered 2 different versions of a component, according to whether or not the data had been loaded. Without even considering writing them in this way, I created ternary functions within the component. It looked 100 times cleaner and would be what anyone would normally do; I know this guy is a really good teacher, so I have no idea why he set it up this way. My point in this ramble is that, only a month or 2 ago, I would have written this code in the exact same way he had, and never strayed from the original code. Now, I understand the code being written so much better and can customize in whatever way I like. Now, this isn't true for everything, a good example of this being GraphQL or Redux. For some of the advanced technologies associated with React, I'm just not there yet. I've advanced in React and JavaScript an incredible amount in the last month alone, though.

I finished up that tutorial just a few hours ago, only running into one big snag that was kind of a showstopper. MongoDB creates IDs as an object, and GraphQL parses everything as a string. When I went to render the very last component, it wouldn't work. I looked up some solutions on Stack Overflow, and I found something that seemed to work for other people, but I could not for the life of me get it to work. I could spend a few more hours tinkering with this bug and eventually get it to work, but I decided it wasn't important enough to spend my time on. My time would be better spent moving forward with something else. So, I did some searching and found another course on Youtube that covers Gatsby from beginner on through. I'm hoping after this course I'll feel comfortable enough to create something in Gatsby from scratch, but I'm still having "writer's block" for creating a new project. In that last course, we made a reading list app, so maybe I'll do something similar to that, something that really doesn't serve much purpose but helps me hone those important skills.

Until tomorrow!

Created by Sam Thoyre, © 2019