top of page

Generated Feedback is a Gift

My Snake game
My Snake game

Before I came to NYU, I was a front-end engineer at a startup in New York. It was a fun job! I got to build features with a popular Javascript framework called React, and learn from my coworkers, who were experienced and generous with their time. Since leaving that role, I’ve tried to come up with projects on my own to maintain my programming skills, but it’s hard to improve without feedback from others. I’ve done my best to gather best practices from blogs and technical books, and unexpectedly, I’ve also found generative AI chatbots like Claude to be a good source of advice.


As part of my journey of Javascript-specific self-improvement, I’ve been identifying topics I find difficult, then building projects that require those skills for more practice. One area that’s always been a little tricky for me is understanding the steps React goes through when it redraws your app on the screen. It’s easy to mess it up and either a) never show any updates, or b) updates the screen so frequently that the app crashes and the screen turns white. Neither one is desirable. A great way to dig into this area is to try to build a game, because games run on a loop that requires updating the screen on a regular interval. I decided that building a classic game, Snake, would help me gain some experience in this area.


Snake is a pretty simple game. It’s usually drawn as a grid of squares, with some of the squares colored in to represent the snake. When the game starts, the snake starts moving in a direction you control with your keyboard or mouse. Food appears randomly, and if the snake eats it, it grows longer. If the snake hits a wall or itself, the game ends. The rules are

Game over screen in Snake game
Game Over!

straightforward enough that I managed to build most of the game logic without trouble, but I did eventually get stuck. I considered asking generative AI for help, but I didn’t want to deprive myself of the struggle to find a solution on my own. I eventually completed the game without it, but I was still unhappy with the state of my code. I still wished I could ask someone for feedback on how it was organized. That’s when I realized generative AI could still help me learn without giving me all the answers.


I asked one question – “how would you structure a snake game in React?” – and Anthropic’s Claude wrote an entire web app, including styling and a long explanation of the role of every file. It was a little over the top, but also very informative. Seeing all of the files together helped me understand the overall structure, and I was able to use that as a model to improve my logic and code organization. The funny thing is, I didn’t even have to run Claude’s code, and it didn’t matter if it had bugs or problems. The general approach was valuable enough to teach me something whether or not it actually worked.


Although I haven’t had time to build many side projects, I have used generative AI as a source of feedback a few times already. I do the work, then ask the machine how it would have done it. It might be the best of both worlds for me! Struggle, then assistance. 🐍 

 
 
 
bottom of page