Vibe Coding is Hard

TLDR: Vibe coding is hard as a project grows. But if you are willing to give up control, it can be a powerful tool to build some MVPs or prototypes. motion controlled game code

Well you might have heard it a thousand times by now, so have I so that's why I decided to try it out - vibe coding as a software engineer.

How I normally code

I use code completion tools to code for a few years now but most of the time the completions need to be examined and sometimes adjusted. Tabbing and accepting everything the large language model suggests is nuts. I really like to understand every line of code in my codebases and when the AI is only suggesting the next 1-2 lines it is pretty manageable. But what if the AI suggests far more than that? Am I willing to give up control?

What to vibe code anyways

For some time I wanted to test out how far LLMs got with understanding requirements and generating code based on them. But I needed a domain I am not familiar with to test things out. Thats when an assignment in a class about Human Centered Design came in handy. We needed to prototype a new game on paper and I decided why not also code it afterwards? It should be a running game and the controls are motion based. I don't have much experience with three.js and motion controls - let's get cooking!

Hooking things up

For the OG vibe coding experience it needed to be a vscode clone - I decided on Cursor because I happened to have some experience with it. And my model of choice was of course Antrophic's Claude 3.7. At least Anthropic knows how to name things so that no one gets confused (I am looking at you, OpenAI! 4o, o4, 4.5 and afterwards 4.1 what the heck?!). To make things a little simpler I setup a vite project and added PWA support because I figured motion sensors need to be requested and handled and iOS support is always a tricky thing. I also looked up some snippets of whatpwacando.today and added them to save some time with the hard stuff.

Let's vibe it

As my grand grand grand fathers would say: When in doubt, vibe it out (full disclosure that's not the case, but I like rhymes) I added a description of what the game was all about and prompted my way through the implementation. I didn't use voice control and I really let the LLM vibe it out. At the beginning things got a little messy it just generated code in random places and I didn't bother with clean code anyways. What stood out to me is that it was really fast but somehow it was as if every prompt was handled by a completely new AI. I guess that's why everyone creates .cursorrules etc. Also it somehow hardcoded every setting value into the code I needed to explicitly say to add variables to the code so adjustments could be made later on.

It was not a big project just a small prototype to wire things up with PWA, motion control and three.js - but I got a sense of what LLMs are capable of as autonomous agents so to say. Sometimes it really got stuck and I had to prompt it to continue but other times it worked zero-shot - and that just felt like the future! Here is the prototype game if you would like to try it out. I only tested it on iOS devices and you have to click the top button to activate motion control.

Conclusion

I really liked it as a way to quickly spinning up a prototype but I felt frustrated at times and the code got messier and messier the more I prompted. I would use it again but would like to examine what it does and perhaps split it up in multiple files to make it more maintainable.

Here is the source code for the prototype game. Thanks for reading!