Remix.run Logo
MangoCoffee 2 days ago

I've been vibe coding a couple of personal projects. I've found that test-driven development fits very well with vibe coding, and it's just as you said break up the problem into small, testable chunks, get the AI to write unit tests first, and then implement the actual code

yodsanklai 2 days ago | parent | next [-]

Actually, all good engineering principles which reduce cognitive load for humans work for AI as well.

BoiledCabbage 2 days ago | parent | next [-]

This is what's so funny about this. In some alternative universe I hope that LLMs never get any better. Because they force so much of good things.

They are the single closest thing we've ever had to objective evaluation on if an engineering practice is better or worse. Simply because just about every single engineering practice that I see that makes coding agents work well also makes humans work well.

And so many of these circular debates and other best practices (TDD, static typing, keeping todo lists, working in smaller pieces, testing independently before testing together, clearly defined codebase practices, ...) have all been settled in my mind.

The most controversial take, and the one I dislike but may reluctantly have to agree with is "Is it better for a business to use a popular language less suited for the task than a less popular language more suited for it." While obviously it's a sliding scale, coding agents clearly weight in on one side of this debate... as little as I like seeing it.

shortstuffsushi 2 days ago | parent | next [-]

While a lot of these ideas are touted as "good for the org," in the case of LLMs, it's more like guard rails against something that can't reason things out. That doesn't mean that the practices are bad, but I would much prefer that these LLMs (or some better mechanism) everyone is being pushed to use could actual reason, remember, and improve, so that this sort of guarding wouldn't be a requirement for correct code.

kaffekaka 2 days ago | parent [-]

The things GP listed are fundamentally good practices. If LLMs get so good they don't need even these guardrails, ok great but that is a long way off, and until then I am really happy if the outcome of AI assisted coding is that we humans get better at using these ideas for ourselves.

kaffekaka 2 days ago | parent | prev [-]

Well put, I like this perspective.

colordrops 2 days ago | parent | prev [-]

This is the big secret. Keep code modular, small, single purpose, encapsulated, and it works great with vibe coding. I want to write a protocol/meta language similar to the markdown docs that Claude et al create that is per module, and defines behavior, so you actually program and compose modules with well defined interfaces in natural language. I'm surprised someone hasn't done it already.

adastra22 2 days ago | parent | next [-]

My set of Claude agent files have an explicit set of interface definitions. Is that what you’re talking about?

colordrops 2 days ago | parent [-]

Are Claude agent files per module? If so, then I guess so.

adastra22 2 days ago | parent [-]

Per source code module?

drzaiusx11 2 days ago | parent | prev [-]

Isn't what you're describing exactly what Kiro aims to solve?

colordrops 2 days ago | parent [-]

Possibly, I've never heard of Kiro, will look into it.

alexsmirnov 2 days ago | parent | prev | next [-]

TDD is exactly that I unable to get from AI tools. Probably, because training sets always have both code and tests. I tried multiply models from all major providers, and all failed to create tests without seen the code. One workflow that helps is to create dirty implementation and generate tests for it. Then throw away the first code and use different model for final implementation.

The best way is to create tests yourself, and block any attempts to modify them

MarkMarine 2 days ago | parent | prev [-]

Works great until it’s stuck and it starts just refactoring the tests to say true == true and calling it a day. I want the inverse of black box testing, like the inside of the box has the model in it with the code and it’s not allowed to reach outside the box and change the grades. Then I can just do the Ralph Wiggum as a software engineer loop to get over the reward hacking tendencies

8n4vidtmkvmk 2 days ago | parent [-]

Don't let it touch the test file then? I usually give context to the LLM about what it's allowed to touch. I don't do big sweeping changes though. Don't trust LLM for that. For small, focused changes its great