Vibe coding tips and tricks

github.com

223 points by mooreds 3 days ago


danielvaughn - 3 days ago

The approach I've taken to "vibe coding" is to just write pseudo-code and then ask the LLM to translate. It's a very nice experience because I remain the driver, instead of sitting back and acting like the director of a movie. And I also don't have to worry about trivial language details.

Here's a prompt I'd make for fizz buzz, for instance. Notice the mixing of english, python, and rust. I just write what makes sense to me, and I have a very high degree of confidence that the LLM will produce what I want.

  fn fizz_buzz(count):
    loop count and match i:
        % 3 => "fizz"
        % 5 => "buzz"
        both => "fizz buzz"
mlhpdx - 3 days ago

> Always: > > Thoroughly review and understand the generated code

Rules it out for me; I haven’t felt I thoroughly understood any code after working with C++ and reading the entries in code obfuscation contests.

It’s a bit of a catch-22 to say “anyone can code with AI” and then make such statements.

colesantiago - 3 days ago

> "Thoroughly review and understand the generated code"

That isn't vibe coding though.

Vibe coding means you don't look at the code, you look at the front / back end and accept what you see if it meets your expectations visually, and the code doesn't matter in this case, you "see stuff, say stuff, run stuff, and copy paste stuff, and it mostly works." [1]

If the changes are good enough, i.e. the front/backend works well, then it's good and keep prompting.

You rely on and give in into the ~vibes~. [1]

[1] https://x.com/karpathy/status/1886192184808149383

asdev - 3 days ago

This is not vibe coding at all, this is reviewing AI generated code

zppln - 3 days ago

On a slightly related note... I'm kind of out of the loop wrt coding with AI. I was trying to find some youtuber working on some interesting project using AI to get a feel for how useful it could be but didn't have much luck (I didn't get past the "top 10 AI tools to use for coding" style videos). I was thinking something in the style of tsoding if you're familiar with his projects.

cowlby - 3 days ago

I'm starting to think of "vibe coding" as "peer/pair programming". How effective it will be depends on how effective I am as the peer reviewer.

The driver is the AI who is highly capable but has a 5% chance of doing something psychotic lol. Me, the peer, can either review carefully and catch errors or just relax and "vibe" through it all. Results will of course vary based on that relationship.

the_af - 3 days ago

> "Warning

Never blindly trust code generated by AI assistants. Always:

- Thoroughly review and understand the generated code

- Verify all dependencies

- Perform necessary security checks."

This of course makes sense, but is not vibe coding.

I suppose we'll see an effort to steer people away from vibe coding nonsense by redefining the term, which makes sense.

oceanhaiyang - 3 days ago

I really don’t see how vibe coding has any place here. It’s just writing bad code without knowing anything it does.

NitpickLawyer - 3 days ago

Even though they are using the wrong term here, the advice throughout the file is solid. I find it funny that it doesn't even mention kiro, which is amazon's take on a vscode clone, that focuses on processes instead of vibes.

nzach - 3 days ago

>Provide detailed specifications for the work to be done

I've been playing around with vibe coding for a few months and my experience doesn't really match this advice.

I used to think this was the correct way and based on that was creating some huge prompts for every feature. It took the form of markdown files with hundred of lines, specifying every single detail about the implementation. It seems to be an effective technique at the start, but when things get more complex it starts to break down.

After some time I started cutting down on prompt size and things seem to have improved. But I don't really have any hard data on this.

If you want to explore this topic one thing you can do is to ask you LLM to "create a ticket" for some feature you already have, and try to play around with the format it gives you.

h4ch1 - 2 days ago

Oh this document outlines exactly how Kiro works. No wonder since this doc and the product are from Amazon.

I like spec driven development, especially for someone as ADD as me. Keeps me from thinking about a new feature while working and dropping everything to implement it.

dismalaf - 3 days ago

My approach to vibe coding:

The chat apps are pretty good at internet searches without all the ads and SEO crap. So I use the chat app, it's okay at context (knows which language and framework I'm using) and can basically get me the same answers as the docs would provide in less time.

Still makes mistakes in code examples though, so I'd never trust it to actually change my code.

EcommerceFlow - 3 days ago

The biggest issue I've had with vibe coding, by far, is the lack-of and/or outdated documentation for specific APIs.

I now spend time gathering as much documentation as possible and inserting it within the prompt as a <documentation> tag, or as a cursor rule.

levocardia - 3 days ago

"The vibe code with detailed specifications is not the true vibe." - Laozi

moolcool - 3 days ago

AI is cool and all, but the biggest thing that makes me think that we’re in a bit of a bubble is seeing otherwise conservative organizations take “vibe coding” seriously

xyst - 3 days ago

"Vibe coding" used to be a meme and used as a derogatory term. Odd to see it adapted as the norm now.

the_doctah - 3 days ago

"vibe coding" is easily my most hated thing I've become aware of recently.

captainepoch - 3 days ago

The day people stop inventing stuff like that and they put the same effort in do really good, quality code... That day, we might start having decent software and not Electron or React apps everywhere...

God bless old times when programmers cared about quality rather than stuff like this... "vive coding"... My God...

tschellenbach - 3 days ago

here's what i use for large projects https://getstream.io/blog/cursor-ai-large-projects/

- 3 days ago
[deleted]
Netaro - 3 days ago

Best vibe coding tip: Don't.

zb3 - 3 days ago

My list:

1. Don't.

2. Don't do it.

3. Seriously, don't.

chamomeal - 3 days ago

It’s so unfortunate that “vibe coding” is the term that stuck. I never want to say “vibe coding” out loud in my life lmao

qwertytyyuu - 3 days ago

This is barely vibe coding, reads like just writing specs lol

__lbracket__ - 3 days ago

I'm probably not explaining this well, but I feel like writing code from scratch has the effect of making us slow down and think more deeply and more globally about what we're writing. Reading vibe code "localizes" our attention to the correctness of the code produced and clogging the processes that otherwise think about connection of this code to other parts of the system.

scheisshausDan - 3 days ago

[dead]