Hack Reactor Week 4 Review
RESTful API, CRUDdy Todo, and Databases
I'm attending the Hack Reactor 12 Week immersive coding bootcamp from 11APR to 8JUL in an effort to develop my programming skills to offer a wider range of services to my clients. The schedule is jam packed with 11 hours of coding content 6 days a week Mon-Sat. I'll be keeping a journal of my experiences with the program here.
The topics for this week: RESTful API and CRUD operations.
Since CRUD is an acronym which stands for Create, Read, Update, Delete, it would be easy to assume that REST is also some sort of acronym. But this is not the case. REST stands for REpresentational State Transfer "by some grad student smarter than me" according to our lecturer.
I looked into this grad student. His name is Roy Fielding, and yes, he is attributed with inventing REST architecture. He also happens to live and work an hour drive away from me in San Jose as Adobe. He also is listed as one of the key authors of the HTTP specification and co-founder of Apache web server. Yes, definitely smarted than me. 🧠
Anyways, these topics carry with them a few subtopics around which our learning was centered this week.
- Dive deeper into async code using standard Node.js callbacks patterns
- Continue to gain an understanding of RESTful APIs and CRUD
- Learn about promises and how they simplify async callback pattern in Node.js
- Practice ignoring complexity by keeping clear of non-relevant areas of the codebase
Two apps were the centerpieces for the week. First was a todo list (a todo list is inevitable in any app-drive curriculum right?) and second was a return to a previous app called chatterbox.
The todo list (CRUDdy Todo) has a simple front end with an HTML form input and button to add a todo list item. The user needs to be able to enter some text, click the add button and have the item added to the list. The user also needs to be able to remove todo items from the list and edit todo items. Behind the scenes, most of our time was spent building the http server that stores and serves the content. We used the http and fs libraries to obtain this functionality. The http library is used to create the server which the fs library functions as our database. The content is stored by writing and reading simple .txt files that contain the todo text. The files are named as zero-padded sequences (00001.txt, 00002.txt ...) and we have a counter.txt file that tracks which number comes next. That's it! Simple handmade db using the filesystem.
Chatterbox is an app we worked on last week with a focus on the front end. This week we are building out the backend to utilize a mysql server for data persistence. It's a step up from our simple txt file system and marks some of the deepest integration between front end and back end that we've done to date!
We still have two lectures each day, one in the morning and one after lunch. Hack Reactor is trying out a "blended learning" format where we watch a prerecorded lecture and then have a 30 min Q&A with TM (Technical Mentor) after. They have been soliciting feedback on it which is nice but I have to say that overall I am not a fan. It can be nice to watch the video on our time, but I'm finding my engagement with the lecture material to be WAY lower than our live lectures. The Q&A after is hit or miss. Sometimes good, sometimes just "does anybody have any questions?" To a Zoom room of 50 crickets 🦗. Some of us consistently ask questions but many are shy. The Q&As that are good learning experiences involve live coding, with the instructor calling on people to answer prompts.
Hack Reactor is not cheap. I don't find myself too upset about the prerecorded format at the moment but I'm also not footing the bill (thank you U.S. Navy). If I were paying my own money, I'd be pretty upset. Since the program has gone full time remote, this seems like another step Hack Reactor is taking to be able to reduce workload on staff and lean out their business model perhaps. I imagine its good for that, but I do believe the quality of learning suffers.
That said, the exercise material is fantastic. I feel that working through these projects is where the real learning happens anyways.