How was I supposed to figure this out on my own?
Not really sure if this matters, but for context I’m currently a CS Master student, was not able to get job or internship after graduating in May 2025. I consider myself a pseudo beginner, where I feel like I know stuff, but also not really.
I am working through CodeCrafters projects because I lack project ideas, and I started with the Build your own HTTP Server. I learned the POSIX sockets API from a book and a LinkedIn Learning course and multithreading stuff (threads, mutex, condition variables, thread pool) from my coursework (although that was POSIX threads API and in C). When I started after the first stage or second stage, I realized I literally did not know how to do anything and all the knowledge from learncpp was if it never existed. I ended up asking Claude a LOT of questions on how to do things or even giving it my own ideas and it saying basically your ideas are trash, let’s do this way instead. I was manually typing out the code and asking lot of questions trying to understand why this way, or why this logic, or whatever else I didn’t understand. Honestly Parsing was especially tough, and Claude did guide me through a lot of it, and I was able to complete the project. I did feel like I learned through this experience, but unsure if I actually did learn because of Claude doing a lot of the work. I at least for sure know I learned how to parse strings in C++.
Anyways, I decided for the next project (Redis) that I would try to not or limit my Claude use, at least for the coding portion, maybe I’d ask it some theory questions. I was utilizing the asio library that was added as a library in the starter code. As one may know, when you do a recv in socket programming, it’s not guaranteed that all the bytes in the tcp stream will come with one recv, so you have to continuously loop until either the client closes the connection or there is something that signifies that this is the end of the request sent. In asio, there is a function async_read_some that does this with a buffer you pass in, and you’ll have to continuously loop, but there is not really a delimiter that signifies the end of the request in RESP bulk string. I figured out the parsing for the bulk string, so now I needed a way to know if I had an incomplete request or not, and how I would do this. I mulled over it for two days looking for something on the internet (maybe I’m just bad at googling or asking the right question?), but I couldn’t really find what I’m looking for, or perhaps my level of understanding was not good enough to understand the various stack overflow posts or articles I’ve read. Eventually I asked Claude and it told me that I needed to use the errors as values pattern, and showed me how to do it with std::expected. When I saw the code it made sense, but I didn’t think about using this pattern at all because well I just didn’t know. I’ve seen it before in one book, but the example program accompanied with it was a toy program that didn’t really have any significance. This is my first time actually utilizing and applying this pattern. When I saw the code it also made my terrible parsing function more modular and better. My question is, how was I supposed to figure it out? Maybe other people might’ve been able to do it without AI use, and I’m just not that smart, but I genuinely don’t know how I would’ve reached that conclusion and that implementation on my own.
Sorry for all the huge paragraphs, maybe I gave more than necessary, I just wanted to make sure the context was there.