3 ms·
This is sort of a funny piece - when I saw "C++ adventure game" I was expecting maybe an ASCII crawler or maybe a simple Box2D rogue-like. The resulting game f
by joenot443 3y ago
This is sort of a funny piece - when I saw "C++ adventure game" I was expecting maybe an ASCII crawler or maybe a simple Box2D rogue-like.
The resulting game from the article is a very, very simple text adventure, with what looks like 3 different leaf nodes. A great way for someone to learn control flow and variable management, but it does beg the question, why C++? And further, why AI?
If someone approached and said "Joe - I want to learn more about programming, and eventually make my own game", I don't think I'd tell them to start with a C++ text adventure. Whatever spark they were feeling in the moment would be sufficiently stomped when they notice the first step in the tutorial is to create a Makefile. Keep in mind they also introduce the concept of variables and if statements. This tutorial's aimed at total beginners!
"Joe, what's a Makefile?"
"Well..."
- lelanthran 3y ago> "Joe, what's a Makefile?" "Well..." "It's this thing you might need for a different C++ project. For this project, one source file is enough" IOW, for someone who wants to write a tiny program, and wants to do it in C++, a Makefile is pointless.
- joenot443 3y agoYeah, I totally agree. I think for learners, whatever can tighten the feedback loop of code->build->error->fix is usually what will keep someone interested.
- sugaroverflow 3y agoHiiiiiiii, GitLab team member and author of the blog post here. Both excited and terrified to be on HN, honestly - what a honor! * Totally agree that the Makefile was a high bar of entry right at the beginning. Since we're working with a single source file, I just opened an MR to update the blog post to compile it directly in the terminal [1]. Do you think this approach would make it more beginner-friendly? * My fondness for C++ might've steered the direction of the project a bit! I considered a 2D platformer at first, but felt that I/o centric approach would be easier for a beginner. I could always rebuild the text adventure into a 2D platformer - would make for an interesting follow-up post. I hadn't thought of an ASCII crawler at all, so thank you for that idea! * Lately, everyone's been using AI assisted code as a helping hand, especially in simpler projects like this one where it's likely to provide helpful suggestions. The integration was an attempt to, of course, promote our Code Suggestions feature ;), and also showcase how AI can function something like copy pasting code from a tutorial by providing you with code you can use. * As for the complexity, I was debating between writing this for beginners vs an intermediate audience and asked myself things like "Can I assume that this person who knows what conditionals like while or for loops are?". After some peer reviews, it became a very introductory C++ lesson. Striking the right balance can be tricky. I'm hoping to get into more complex code in future parts, but first I really need to introduce functions because the code needs it haha. Thanks for your valuable feedback and things to think on, super appreciated! :) [1]https://gitlab.com/gitlab-com/www-gitlab-com/-/merge_requests/128745 https://gitlab.com/gitlab-com/www-gitlab-com/-/merge_request...
- dnsmichi 3y ago> Whatever spark they were feeling in the moment would be sufficiently stomped when they notice the first step in the tutorial is to create a Makefile. Keep in mind they also introduce the concept of variables and if statements. This tutorial's aimed at total beginners! Thanks for your great feedback. I suggested using a Makefile during blog post review [0], to avoid explaining gcc compiler flags, and have a single command with `make build` available for future, repeated compilation steps. I did not expect this to be an entry barrier, and will reconsider suggesting makefiles in the future. Thanks again. [0] https://gitlab.com/gitlab-com/www-gitlab-com/-/merge_requests/128536#note_1521593150 https://gitlab.com/gitlab-com/www-gitlab-com/-/merge_request... (GitLab team member here)