I have to admit: vibe coding is both the best and worst thing that has ever happened to introverted developers.
Why?
You don't have to work with other people and force yourself to speak about what you think.
Where are the bad sides?
You still have to do it, but know you're talking to an AI. A rubber ducky that answers!
I'd say, that's progress 😉
Let me share with you what I learned about vibe coding, while vibe coding my way to mastering how to vibe code!
GOOD: Jumpstarting a project
One thing that Vibe coding is perfect for is jump-starting a project.
It's like creating a project from a template, with everything you need, like building and deployment scripts1.
Of course, you wouldn’t want to jumpstart a project with a complete description of it, but rather from the simplest feature (think Splatoon prototype, back when it was a game about tofu blocks) and then build on it iteratively.
Why? Well, one of the best things you want to have is a WORKING prototype as fast as you can, and as often as possible (as in, every change should result in a working game, not a broken one). This means that with every change, you will have a point to return to. If you won't do it this way, you will have to return to a very early version of you project, once you (or the AI) screw something up along the way.
GOOD: Doing the math!
Rejoice, game developers! You will never have to write math or physics for your games. Generative AI will do the work for you.
MID: One prompt might not cut it
Some developers believe that you can do your job with one prompt.
This solution will not work for everything.
It gives you less control over the result.
Sometimes it's good to put you on the path, at least until the moment you have to reuse the code and code quality comes into play.
MID: Random outputs to the same prompt
Albert Einstein did say that it is madness to do the same thing over and over and expect different results. Well, Albert Einstein never used an LLM 🤣
If you decide to work iteratively on a prompt (and at some point you will), you will notice that doing a project from scratch 10 times in a row can lead to different ideas on how to implement it.
Are they better in the end? No.
Are they better at the beginning? No.
What are they then? Different.
You need to see for yourself which approach was better.
You can work faster with an AI. You still need technical competencies, though.
BAD: Hallucinating functions/API endpoints that do not exist
Generative AI produces good-looking code, usually. Until you compile it and notice that some methods do not exist2. Why? Because the LLM hallucinated that function. Just so. Even if you provide it with the documentation containing all the functions, it might hallucinate a new one.
Thankfully, code-assisting AIs usually will notice this bug once they compile it or read the logs.
BAD: Working entirely independently
AI is like an intern who wants to prove itself by doing everything alone.
But as with any intern, it will not write down what is wrong if you don't tell it to.
It will not implement most of the best practices if you don’t highlight them first.
If you won’t enforce a library, it will try to write one from scratch 😉
Let me tell you a Vibe coding anecdote.
Some time ago, I tried to solve a problem with AI-written Rust code.
After many attempts, I got tired of it, and I decided to do it with my first-choice programming language. C#.
I told it which library to use. It decided to use the API instead.
The API was deprecated, so it used version 2 of the API.
It encountered some other problems, which started to annoy me. But I just clicked and approved every access request.
And at some point, it decided that it doesn't work, and it will start from scratch with Python (WTF!?). So I let him, although I wasn't annoyed anymore, I was starting to get pissed.
He created some code, informed me it knows how to handle it, wrote that it doesn't need the Python code, removed it, and it returned to C#.
It built the code successfully. It ran the code. I watched the flow go flawlessly through all the requirements, and then it showed me an answer. It was correct.
I was speechless.
AI is like a surprisingly competent army.
The only problem lies in equally competent leaders. Us. To steer it towards the outcome. But to handle AI in code creation, you have to be technically competent, unfortunately 😉
And yes, you should turn this code into a template you use outside of Vibe coding. Why? You will learn later!
Sometimes you’ll have to launch the code, and only after some debugging, you will notice that the 404 on that GET endpoint doesn't mean that the object you want does not exist, but that endpoint doesn't exist. Damn, I hate it when that happen 😉
It says "Image not found" for me.
Or is that how it's supposed to be?
Great post and fascinating topic! You didn’t explain how to adapt AI-generated code to your template, which seems crucial. Is it safe to use it in the final product? Could it be less efficient than your own code? What prompts would you recommend to help AI structure the code for your template?