How to Get Good Results from Vibe Coding

• Jason Ladd

Whether you like it or not, LLMs are here to stay (at least until something better comes along), so there’s no point in hiding. If you’re a programmer, it’s probably a good idea to use AI tools to speed up and improve your workflow. But what’s the most effective way to do this? If you’re new to coding, you might think that you can just write a prompt like “create a cool app that makes a lot of money” and boom, your digital genie will bestow upon you all the code you desire, and it will all just work perfectly. Honestly, someday soon it might work like that, but for now you’re likely to disappointed if you go that route. So let’s discuss how to actually “get good” at vibe coding!

Ok so first of all, you have to recognize that there are a lot of “AI” tools out there, but they’re all pretty much just LLMs or Large Language Models. Sometimes people also refer to them as GPTs, or Generative Pre-trained Transformers… I’ll probably explain what that means in another post because its a huge topic, but basically the LLM is the model of the data that these things are trained on and the GPT is more like the whole application which uses the model to generate responses to prompts. But anyway, for all intents and purposes, LLMs and GPTs are same thing when talking about AI tools. The main thing to remember is that the different tools available to you as a vibe coder are basically just different interfaces for interacting with LLMs/GPTs.

In my opinion, the most import thing to realize is that AI is a tool to help you create software, not a genius 10x developer that creates it for you. For one, it can’t read your mind so you have to be very specific about what you want it to do. If you don’t know how to explain what you want from it, you won’t be able to get the results you want.

So what are some really useful ways of interfacing with “AI” when it comes to getting help creating software? In my experience there are lots of specific tools out there but the best way are using LLM chatbots like Claude and ChatGPT and IDE assistants like Github Copilot for assistance in:

  • Planning and Architecture
  • Code and Test generation
  • Debugging
  • Explanation and Learning
  • Researching Documentation

Planning of Your Project

There are an almost infinite amount of ways to create software. Some actually are better than others depending on what the end goal is. So before you start asking the AI to create things, it’s important to understand what problem you’re trying to solve and what the best way to solve it will be. You’ll need to decide some things up front. Is it best to create a web application, embedded application, mobile app, desktop app, etc? What programming language(s) will you use and why? Will you need backend code or a database? Where will your code be deployed and hosted? How will you test the code? And many more questions need to be answered because it will be difficult even for AI to switch later if you realize you need to.

But not to worry because if you can explain to your AI assistant what problem you’re trying to solve and what solution you want to use (and be very specific), it can do a pretty good job of steering you into the right direction and helping you make informed decisions. In this stage, it’s best to chat with it and ask it questions to help you plan before asking it to write any code at all. It is usually pretty good at giving you a few different architectural options and explaining the trade-offs of each approach.

Getting the Code Written and Tested

Once you know what it is that you want to build and what programming languages, platforms, etc. you would like to build with, you can start asking the AI to generate code for you. At this stage, you still will probably not get good results from asking it to build your entire application with all the features you want, all in one go. LLMs have problems with what’s called a ‘context window’ which basically means, if they try to process too much information at once, they’ll lose track of what they’re doing and either conk out or just start hallucinating (making stuff up that won’t work).

What works best is prompting the AI to write code for specific chunks of functionality and testing those out as you go to make sure it’s creating what you want. You’ll most likely have to re-prompt when you don’t like the results or ask it to change things until you get your desired results. Keeping it focused on smaller chunks of functionality makes this process much less of a headache than letting it generate all the code in one go and realizing it needs correction and tweaks in lots of different places. If at all possible, you should try to follow along and make sure you have a solid understanding of what code is being generated. It’s never good practice to blindly trust any code and just put it into your project, whether it came from an AI or another human. How do you know it’s not dangerous? You’re ultimately responsible for all of the code that’s written in your project so you should try your best to understand what it’s doing.

Also consider that it doesn’t really make sense for AI to create a basic boilerplate application for you to start with if you can find an open source project to get you started. Don’t waste electricity and water getting it to generate a fresh “To do” App for you if you can just git clone an existing one and have it start adding your specific changes and features. I think the DRY principle (don’t repeat yourself) should apply to AI too!

Oh and TESTING. Don’t neglect it. Unit Tests. Integration Tests. End to End Tests. You need them more than you probably realize. Writing tests kinda sucks, I know. But the cool thing is, AI will help you write them.

Debugging

Ok, so now you’re moving along in your project and code is being written by you and your AI assistant. Awesome! But you will inevitably come across things that either don’t work how you want them to or just flat out don’t work at all. You have to remember that LLMs are not really ‘intelligent’ beings… they’re just using (some really advanced) mathematics and probability to predict what the next word or ‘token’ should be, given everything that comes before a prompt. So that means they will generate code that ‘looks’ right, but that they haven’t actually tried to execute to verify if it actually works or not. Don’t assume that just because it’s a computer, AI is actually running the code. But hey, to be fair, us humans do the same thing sometimes. So there will be times where either you or your AI coding assistant wrote some code that’s broken.

There’s a lot you can look up (or ask your AI companion) to learn more about debugging, but at the basic level, you should know how to add breakpoints in your code that write values to the console after specific lines of code. This will allow you to step through your code and see exactly where the breakdown is happening, so you know what needs to be changed without a lot of guesswork. Along with this, it’s important to know how to read logs and understand what error messages are trying to tell you. If you can’t quite grasp what the message is, just ask your robot pal who will be glad to break it down for you.

In addition to traditional debugging, it’s essential to learn how to use tools like Github Copilot to get feedback on certain chunks of code that might not be behaving like you want. Sometimes you might need to switch between different models to get better results since some of them have strengths in solving particular types of problems. You have to also not be afraid to call the AI on its own bs sometimes and ask very specific questions like, “its this line of code really necessary if we’re already doing ?”, or “what is this block of code doing?”. You’ll either get on one of those “You’re absolutely right!..” Type of responses and end up steering the AI in the right direction, or it will teach you something you didn’t know! Either way, it’s a win.

Explanation and Learning

Like I touched on in the section above, it’s very beneficial to ask the AI to explain to you what certain parts of the code are doing if you’re not 100% sure yourself. Even if the AI is writing most of the code, it’s still up to you to make sure it’s functioning properly. For example, if you end up releasing something that exposes sensitive data about your application’s users, everyone is gonna blame YOU, not the LLM or even the company that created it. Also, it’s important to realize that software applications can get huge with tens of thousands (or many more) lines of code. Making changes in one part of the application often affects other parts. Since you’ll be building out features and making changes over time, that means that sometimes the AI (and yes, even you) will end up leaving things in the code that don’t need to be there. To avoid weird bugs and security vulnerabilities, it’s important to keep the codebase clean. Asking the AI coding assistant to evaluate different parts of the code will help keep it structured in a way that’s easy to keep building on and maintain.

In addition to having AI explain parts of what it wrote to you, one of the most underrated and powerful aspects of AI is having it explain difficult to grasp concepts to you. Instead of just using it to speed up your workflow by writing code for you, use it to teach you concepts about programming and computer science. Of course, you should be reading books/documentation and watching videos created by actual humans but it’s rare that you can actually asks questions and get clarification from those humans unless you’re enrolled in a course somewhere or know them personally. One great thing about AI is that it doesn’t get frustrated if you don’t understand something right away, so you can ask it as many times as you need from as many angles as you need until you understand. So, for example, if you’re having trouble wrapping your head around why certain abstraction patterns can be useful, or what the low-level implementation of some code is doing, getting help from AI to understand the concepts will help you write better code in the long run… which leads me to my next point… reading the docs.*

Documentation

Code itself is just a tool and all good tools have instruction manuals that explain what you can and can’t do with them. In the world of programming, those instruction manuals are the documentation. When writing a program, the most basic level of documentation is the set of specifications for the programming language you’re using. You’ve got to know the specs to understand the syntax and the different paradigms/patterns available to you. Also, in your project, you’ll most likely end up using Libraries which are essentially a bunch of predefined chunks of code written by other developers. Sometimes, it’s tough to know if you can accomplish what you want or how to accomplish it with a particular library.

Let’s be real though, code documentation can be very lengthy and as developers, we don’t always have time to spend reading up on it in advance. So one thing that frequently happens is, we choose some library to help us solve a problem, like for example a file compression library, and we run into a scenario where we can’t figure out how to work with a specific type of file or something. In those cases, AI is like an assistant that has had enough free time to read through all of the docs, even the most obscure parts, to know how to accomplish what we want. In these situations, you can lean heavily on AI by asking it specific questions about the limitations of some programming language or library and for it to show you the part of the documentation that describes it.

Source Control

I won’t go into detail about how to implement Source Control or Version Control in this post, but I think Vibe Coders who are new to programming often neglect this because it looks like something that’s just a complicated obstacle ‘in the way’ of you actually being able to see your code in action. But it's imperative to take the time to learn at least the basics of something like Git and a platform like Github or Gitlab. The main thing you need to know is that Source Control allows you to take snapshots of your code at different points in time over development and shows you which changes were made. A common scenario is, you made a change in some code, tested out that feature locally, pushed it to production, then later on found out some other functionality in the app stopped working. With Git, you can step back through your commit history and see exactly which changes were made (and by who if you’re working with other people) which is invaluable in tracing updates that broke the code. Also, most code projects have development history that ends up spanning YEARS, so trust me, you won’t remember all the random little changes you made so you’ll want a system to keep track of them. There’s more to it than that, but ask your assistant for more explanation! I’m sure it will tell you it's necessary.

Conclusion

In my opinion, the most powerful use of AI is to augment the natural ability of humans. Humans have never really been great at rote memorization, and although you can definitely train yourself to be better at it, there’s never been a time in history where we could offload those types of tasks to machines so that we can focus on the higher-level tasks, like there is now.

Consider this, programming languages are all forms of abstracting what is actually happening at the machine level of the computer. At the lowest level (closest to the metal) software is the sending of pulses of high and low voltages that get interpreted to binary numbers, which get passed around in memory and have arithmetic done on them to process information. In the early days of software, programming was done by writing the 1s and 0s, which is called machine code. This obviously made programming a very tedious process and would be very slow to build large scale applications. Then assembly language was invented to abstract parts of machine code to make it more interpretable by humans so we could reduce the chance for human error and speed up development. Then languages like C were invented to abstract assembly language to make the process even more efficient. Then languages like Python were created to abstract some of what’s going on in C. Python is relatively high-level because if you’re trying to implement a Machine Learning algorithm, you’re much better off being able to focus on the mathematics and statics necessary to accomplish your goal than the hardware memory management of the specific processor you’re working with. Although it’s not exactly the same, LLM tools are kind of a new form of abstraction in dealing with computer code. I still think it’s necessary to understand what your code is doing, but using it as a tool to make writing code more efficient just makes sense.

So with all that said, I personally would avoid using the AI tools that do every part of development process for you. The power of being able to write software is in understanding how to create and take ownership of computing power. If you don’t understand what’s being created and you don’t have control over it, you don’t really own it. So take ownership of your code. The knowledge is the power.

Binary Search in Go

Binary Search is a fundamental searching algorithm that you can use to find a number in a sorted array. The general idea is, since the array is sorted, you can check the value of the middle element, see if the value you're looking for is less than ...

Working with The Graph Data Structure in Go

Representing Graphs in Code Graphs are just a data structure where a bunch of nodes are connected to each other by imaginary lines called edges. They're really similar to linked lists and trees except pretty much any node can be connected to any o...

Binary Trees In Golang

Binary trees are a fairly simple data structure where you have a node that contains some data, and a max of two child nodes that also contain some data, like this: 1 / \ 2 3 Each child node can also have up to two child nodes, and...