Vibe Coding Is Fun–But Vibe Refactoring Pays the Bills
51 comments
·May 6, 2025lolinder
jsheard
> The author's description of vibe coding
Judging from the style and complete lack of substance I don't think there is an author, unless you count ChatGPT as one.
That didn't stop the submission from rocketing to #1 on here though since it jingles the right set of keys.
rafaelmn
The articles getting to top are getting worse rapidly - low effort AI crap with a random headline gets to the top of HN regularly.
I have a feeling a lot of "vibe coders" are joining the community. Could be bot spam too. At this point I'm starting to miss the liberal thought pieces.
Freedom2
It's interesting because this site usually encourages 'curious' discussion, and there was always an impression that the userbase was mature enough to spot these kind of substanceless pieces easily.
codyvoda
eh terminology happens. I’d argue we shouldn’t be using “AI”, but here we are. I’d prefer encouraging “vibe coding” to mean this over fighting against the wind
lolinder
But what is "this"? It's just refactoring with an LLM along for the ride! That's increasingly the default assumption when we're coding or refactoring, so the extra "vibe" attached at the front is totally meaningless if it doesn't imply that you're going so fast you're not checking the LLM's work.
laborcontract
Disagree gently here. Vibe refactoring is so much harder than vibe coding. I understand the temptation of having LLMs refactor code because that's ostensibly what they're great at – "transforming" the code. But LLM's are opinionated enough where they love to arbitrarily drop features or constraints for no particular reason, and they won’t tell you what they dropped along the way.
Proper refactoring with an llm requires full testing coverage and, by the time you do all that, is the refactoring really necessary? I prefer 100% stability. If you're refactoring the because it's poorly structured and unreadable, that’s okay.. LLMs can help understand it.
In my use of llms, i find it’s actually much easier to rebuild something from scratch rather than refactoring flawed code. It’s much less likely to inherit strange assumptions and code smells that way.
With all that said, the one prompt I do use when refactoring is to tell the llm to do a lossless refactor and then follow up with a "was this really lossless"? It's not foolproof. LLM's love to lie.
pmarreck
> Proper refactoring with an llm requires full testing coverage
Proper refactoring WITHOUT an LLM requires full test coverage! But most definitely WITH an LLM.
In cases where there is no test coverage, the first thing I do is have the LLM write one test at a time. The problem there is that if you truly wanted valid tests, you'd have to actually break the code, watch the test fail to prove it was valid (basically, the inverse of TDD) and then re-fix the code and start on the next test, but in practice, it is difficult to get an LLM to stick to this loop. I wish someone would train or refine some coding LLM to use either TDD or this form of "inverse TDD" where you're applying tests after the fact and also want to check their validity. (Or tell me how to do it.) Because mere prompting doesn't seem to stick- it always regresses to the mean eventually.
(I'm currently seeking work, btw, and would probably be happy to help refactor old code, advise people on code, etc. Sorry for the self-promo.)
mg
Refactoring is indeed one of the areas where LLMs already shine bright. And I love it.
I have been coding since I am 12 years old. I always loved writing code. But I also always loved reading code. I don't know, for me code is a kind of art. Never met anyone else who sees it like this. When a friend was hiring for his startup a while ago, I was happy to sit down for multiple hours and read all the code the applicants wrote and gave him advice on whom to hire.
So for me, the new times are paradise. I try to not touch code directly anymore. I write prompts that would enable a really good developer to implement features and then let various LLMs work on it. Afterward, I rate the results so I have an overall score for each LLM. I pick the best solution for my codebase and manually finetune it to perfection.
After each commit, I also ask the LLMs if they can find anything in the files that can be refactored to make the code shorter or more logical. The result is that the codebase becomes better and better. Because the LLMs often find stuff to improve. They usually come up with 10 ideas I dislike, but also one idea that I like. And so the codebase becomes better and better over time. Instead of worse and worse like in the past when you had to keep a balance of refactoring for the sake of beautiful code and building new features. Nowadays, refactoring becomes more and more free.
candiddevmike
> I also ask the LLMs if they can find anything in the files that can be refactored to make the code shorter or more logical
Citation needed? The worst kind of code tends to be clever code. This seems like a lot of code churn for no real benefit other than some loose definition of "better". How do you prevent bugs with these constant refactors?
johnpaulkiser
Man, I must really suck at this stuff. This is not at all my experience. Asking LLMs to refactor almost always results in hasty abstractions that I want to keep out of my codebases at all cost. Am I not letting go enough?
Volundr
FWIW this is my experience too. I use LLMs pretty regularly for coding but to get decent code you really have to supervise the hell out of them and often it's not worth the effort to push them into doing the right thing.
Maybe I'm just bad at getting it to do things, but I think your question about "letting go" is the real story. I think there are a lot of people not paying close enough attention to what's coming out of the LLM, and the tech debt building up is going to come back to bite them when it builds to a point the LLM can no longer make progress and they have to untangle the mess.
mg
The way I "ask" is that I really ... ask!
I ask the LLM "Can you find anything in this file(s) that can be made shorter or more logical?"
And then as I said, I like less than 10% of the ideas the LLM comes up with. But it is so fast to read through 10 ideas (A minute or so) that it is well worth it.
null
lukev
So, I know the battle has been lost for the definition of vibe coding (https://simonwillison.net/2025/Mar/19/vibe-coding/).
But we definitely need a word that makes a distinction between a LLM autonomously generating software, and having a human ultimately curating all the code (even if they're using a LLM to generate it.)
If not vibe coding, what should we call that?
StrandedKitty
Simply coding. It's going to be AI-assisted by default. It already is for students getting into programming, and it'll take some years for old people to pick up these tools too, but I imagine we'll get there pretty soon.
headcanon
Where do you draw the line though? Is it only vibe-coding if you don't touch a single line of code? If I ask Cursor agent to implement a basic refactor vs doing it by hand, does my level of "vibe" increase?
Why do we need a term anyway? Neologisms are nice for writing articles but I feel like we get lost in the weeds unnecessarily trying to categorize things. Its like trying to come up with genre names for electronic music. The more terms we create, the less useful they become.
I always thought of it as a temporary term anyway while we reconcile this technology with the status quo. In a few years I'll bet it will go back to be just "programming" or "development".
haswell
> Why do we need a term anyway?
For the same reason I think it’s useful to distinguish between purely AI-generated imagery vs. using AI tooling in some specific and restricted way. e.g. if someone uses an AI de-noising program on a RAW photograph, the implications of that are entirely different from generating the entire image.
Until recently, it was not possible to generate sophisticated programs from scratch across a wide variety of problems domains without being involved in writing the code. This type of “development” is entirely unlike a more limited “AI-assisted” workflow and the implications of each are quite different.
As a viewer of artwork, how the art was produced entirely changes how I value it.
As a user of software - especially in certain categories - how the software is produced also changes how I value it, whether or not I trust it with my data, would be willing to install it in my computers, etc.
To your point, there’s a spectrum of AI involvement. But I think it’s necessary and useful to have language that helps identify software that sits on the extremes of that spectrum. Classifying things across the range is more difficult.
croes
If don’t touch a single line of code, you aren’t coding.
Or where your customers/bosses vibe coding when they told you their requirements?
LostMyLogin
Judging by the younger group coming out of college that I interact with, it's just coding. This is just how it's done now.
Workaccount2
It's going to be a spectrum so will be hard to divide up.
I know a crash-course-day's worth of programming language(python and C), but very strong understanding of the principles of programming. So LLMs are a godsend because I can basically write code, function by function if need be, in English.
"Create this variable, do these mathematical transformations on it with retrieved value from API, display the output of it here, also compare it to the output of everything in the test set, store differences greater than 30% to their own set, store all values in an SQLite database, create a simple GUI with a field showing each output, make a button that outputs the results to a .pdf, give it a title block with labeled results listed, etc. etc."
Does coding become vibecoding when you do it in English? hah
gherkinnn
What do you call coding with Intellisense? What di you call coding while referencing documentation?
wccrawford
I find this happens for pretty much every name that doesn't actually match what it is suppose to describe.
In this case, most people have to be told what "vibe coding" is. I think hardly anyone guesses what it is by just hearing the name.
So I'm not at all surprised that people are using it to mean other things already.
pizzafeelsright
What do we call emails that have been spell checked?
croes
What do we call automatic generated emails?
Usually spam
skybrian
I don’t really get what they’re doing. This would be a better article if they actually explained how they use repomix.
empath75
Be _very_ careful about refactoring with Cursor -- it has a tendency to randomly delete important blocks of code and comments and re-order things in a way that make for difficult diffs to read. Make sure you do it in relatively small chunks and do PRs and have others review. The larger a refactor you do, the more difficult/impossible it becomes to actually review the code usefully.
Izkata
Or adding. I've had to point it out multiple times to a co-worker when Cursor keeps adding the same thing to a data structure that shouldn't be there.
lylejantzi3rd
Are we at the point yet where companies are looking for programmers specifically to fix their vibe coded codebases? A codebase restoration expert?
Or will they do what most companies do when they sink millions of dollars into a codebase that doesn't work: dump the codebase, dump the team, hire a new one, and build from scratch?
What does everybody think?
edit: oxford comma is life.
mbeavitt
Did you use AI to write this blog post? Be honest.
Yiin
my first though as well, it was like reading any other chatgpt response
ChrisMarshallNY
I tend to use tools like ChatGPT to refine my code.
i.e. "I have this function. Can you suggest ways to make it more efficient?" etc.
Sometimes, it gives good feedback, sometimes, not. I almost always need to modify whatever it gives me.
mentos
Are any of the freelance software dev marketplaces seeing an uptick in opportunity to refactor vibe code?
Probably an opportunity to category kill that niche.
"Got a vibe coded prototype you want to make more robust?"
numbsafari
Hiring a bunch of recent college grads to build your startup is fun. They're great drinking buddies and they make you feel young again. They'll inefficiently work around the clock, sleep at the office, and treat it like their mom's house, and make you think you're a big, important boss.
Coming in as a gray hair to fix their disaster definitely pays the bills.
The author's description of vibe coding seems to have confused it with getting into a flow state in a vaguely AI-adjacent way. Vibe coding as originally coined by Karpathy [0] can't pay the bills because it would be wildly irresponsible for a professional to do—it's the kind of no-checks minimal-validation AI usage that gets lawyers into trouble for submitting legal documents with hallucinated court cases, just translated to coding instead of law.
What the author is proposing isn't really "vibe" anything, it's just dedicating a small amount of time to fixing tech debt in a way that happens to involve an LLM as an assistant. The LLM in this model is honestly mostly superfluous.
Don't get me wrong, this absolutely is how LLMs should be used in a professional setting, but I just question why we needed a name and a blog post for it. This is just responsible code maintenance as it's always been.
[0] https://x.com/karpathy/status/1886192184808149383?lang=en