A Little Bit of Both
I spent the majority of my day today at the golf course, teaching my ladies' clinic and then playing a round of golf. The clinic went well, and I broke the news to the ladies that I was leaving my club for my new job. They were disappointed and sad to see me go, but also encouraging that I would pursue something new like this. After we got done with the clinic, we realized all hell was breaking loose on the operational side of things at the course. We were inundated by guests and members, and a couple of our staff decided they weren't going to come in to work today. One of the guys in the clinic who was scheduled to work the shop today should have taken himself out of the clinic to follow his duties, but didn't, and put the other 2 guys in a real bind. They weren't happy with him when we finished the clinic, and I tried to help the crew out to get them back on track. By the time the players went off at noon, everything was back to running somewhat smoothly, so we went out to play a round. I played terribly, still mentally unable to get past the injury to my left leg. In golf, it's imperative that you use your lower body to make a proper weight shift from the right side to the left side in the downswing. Right now, my mind is telling me that's a bad idea and that I'm going to hurt my ankle, which is really not the case. This led to some really interesting shots, and left me with an inordinately high score. Still, it was great to get out and play a round, especially since it might be my last at the course.
After grabbing some dinner with the family and getting the little one all settled for bed, I got to work. I started out thinking I was going to focus my time on Andrew Mead's The Modern GraphQL Bootcamp, which is getting to some really interesting, yet incredibly challenging parts of the course. Right now, we are dealing with authentication. Authentication is definitely not straightforward and there's a lot that goes into it. You end up having to use several outside packages to get everything to work right and have to manipulate an HTTP header to find the token that you need. There's a lot of steps involved, and it's just a lot to wrap your head around. Don't get me wrong, Andrew is doing a great job at explaining it and we're taking it step by step, but it is mentally taxing. First, we started on all of the mutations. We took all of the code we had already written and rewritten several times, and once again we modified it to use a helper function that parses that HTTP header to find the token associated with the user and try to match it to the user in question. If it's not a match, an error is thrown, thus showing the user is not authenticated. It's a great way to do this, but like I said, there's a lot that goes into it. He showed us how to do a couple of them, like deleting and updating a user, and then cut us loose to finish up the rest of them. I had a couple of issues that were throwing unnecessary errors, but for the most part, I did pretty well. After this, we started to go down the road of authenticating queries as well, but I decided I'd had enough on this subject for the night.
So, I switched over to his other course I'm taking, The Modern JavaScript Bootcamp. The material being discussed in this course so far is definitely an extreme review for me, with plenty of challenges along the way. The challenges are a great way for me to test my actual understanding of these basic concepts, and so far, I'm feeling pretty confident in my abilities. I'm sure as we progress through the course, we'll get to some concepts I'm not nearly as confident with, such as advanced object manipulation or asynchronous JavaScript, but for now, I'm definitely in my comfort zone. I made it through about half of the arrays section tonight, which basically just introduced the idea of an array, and a couple of things you can do with them. Like I said, some of this stuff is an extreme review for me, so I'm breezing right through. I did learn a few things, though, or at least there were a few things I knew but not as well as I might like to. We went over the splice method for arrays, which I've used plenty of times, but always forget exactly how it works. It's one of those things I have to look up in the MDN docs every time. The way Andrew explained it seemed to stick a little better for me, so hopefully next time I need to use it, I can remember how to do so without having to look it up. The other one is the forEach method. This is such a simple method that basically replaces the for loop, but I never remember how to use it correctly and end up using a for loop instead. All the forEach method does is take in a callback function with two arguments, each item in the array and the index of the array item. From there, you can set up the function to do whatever you need it to do. Like I said, it's much simpler than using a for loop to loop through an array and does the exact same thing. Other than that, it's been smooth sailing in this class; I'm just trying to get through the easy stuff to get to something more challenging.
Until tomorrow!