Framework on solving problems

Simple question but for you guys, how do you look up how to do something you have never done before? I’m currently doing the http server challenge and I’m at the second step. When I google this step to find a solution I find completely different solutions compared to the code examples that users submitted. I kinda feel like it’s also cheating to copy code examples instead of writing or solving it myself So I’m like am I heading down the wrong direction or maybe just a different way to solve the problem?? Can any of you guys give me some type of framework for solving all problems and just this challenge.

For the HTTP server, my recommendation is to just read the documentation. Have a general look at the network programming documentation for your preferred language (official documentation or topic-related books and guides). Then, when you grasp the general idea, search for the specific topics: binding, sockets… and the idiomatic approaches (threads, fork, event loop).

Then a bit of HTTP and you should be done with the challenge.

1 Like