This is part of a series of blog posts that stemmed from my first experiences with “vibe coding”. For more on what I did and where you can find the rest of the posts, please refer to the first post.
There are a lot of demos floating around the internet of vibe coding in action. Nearly all of them are based on someone building something from scratch. There’s a reason for this, legacy code is hard to read and modify. Claude, just like anyone else, has never seen this app before. While it can read it quickly, if the code quality is low, it may not get anything out of that read. Additionally, even when you explain things it has limited memory and so may not remember them later.
I discovered this when I was looking to make a change to how I calculated the scoring. The change itself was rather simple, but I found myself needing to explain the details of where to gather the values from. For example instead of just saying “calculate how far over .500 a player is” (which most people reviewing my code would have been able to do), I found myself saying “I need to query the table whose name is stored in the variable env.registration_table_name [this is the constant that holds the table name for dev/test/prod]. That table contains a list of users, for each user there is…” If you’re really curious, you can look in the picture below but you get the idea…
The reason for this is that the agentic system is largely working on a small portion of the code and needs to be given context about where/how it can go get the data it needs to do the calculation I asked it to. It also needs context about where it has to store the data once that’s complete. These are items that a developer who has been working on projects for a while would already know and be able to add easily.
That all said, I will give Claude credit for two things.
- The English definition of where the data was and what I wanted to be calculated was still easier to write than the code would have been (though that may not be true for a better developer).
- Claude did a good job of creating well structured code to accomplish exactly what I asked for. The only exception was that it made a Silly Intern mistake. If you look closely, it initiated the variable “winnings” as an integer. Winnings are calculated in dollars, so we’re definitely going to need the numbers to the right of the decimal point!!! This is just an example of how AI Coding Assistants are kind of just interns (which I covered in this post)
Ultimately, while I don’t think that genAI Coding Assistants are useless for legacy code, they are certainly not the miracle that they are for “vibe coding” some new application. I’m going to cover in a later post one of the work arounds for this (leveraging GenAI to clean up your code before you use it to enhance your code).
