Lecture: Basic Networking and JSON Parsing
Practice basic networking and JSON parsing using the Random Users API.
I had a blast teaching this particular lesson. Lambda has a program called "After Hours" where students who want to get a little more exposure to the material taught throughout the week can come to an evening lecture and practice those concepts. This was my first opportunity to teach an After Hours lecture, and I was nervous and unsure of myself. During the course of the lesson, I realized how much I had actually mastered as a result of my Lambda School learnings, and thankfully the effects of imposter syndrome began to dissipate.
The day before this lecture, students had been introduced to a lot of networking concepts that were difficult to grasp all at once. They understood the functionality of things like a URLSession data task, the Codable protocol, and JSON parsing, but didn't have a whole lot of easy opportunities to practice them all together.
In this lecture, I utilized the Random User API and demonstrated the malleability of a model object that can decode specified data if the JSON is parsed correctly. The students were able to immediately see the effects of properly decoding JSON by having table view cells populate with different information like random user names, phone numbers, emails, etc.
As the lecture finished, I reflected on my own understanding of networking concepts and was empowered by how far I had come since first learning about them only a few months ago. While the lesson attendance was completely optional, almost all of the students were present, engaged, and grateful for what was taught.
JSON parsing can be tricky at times, especially when no two APIs or data sources are the same. By the end of the lecture, not only did I feel confident that I could parse virtually any JSON I came across going forward, but also that my dozen or so students would have a much easier time dealing with JSON in the future.
The repository for the completed project can be found here.