Vibe Coding Learnings

After spending some time coding with LLMs, I feel like I've caught my footing and have the following takeaways:

Cursor is Worth it

For much of my career I'd often have my dev environment yanked away entirely and have to relocate to a temporary F.O.B.  This was usually done to solve some time critical emergency.  Since I didn't know where I'd be when disaster struck I had to be ready for any environment.  I learned to code out of VI because I knew I could count on its availability on whatever piece of hardware I ended up on.  I learned NOT to rely on IDEs.

When it came time to try out Cursor as the tool of choice for AI development, I was hesitant.  I stuck to CLI prompts, copying and pasting.  Cursor truly is superior here and worth the investment.  Its ability to learn context places it well ahead of the pure CLI tools I've used. 

The Bots are Bold

If you were speaking with a teammate and something was ambiguous or unknown, that person would likely ask a clarifying question.  You can't expect the bots to do that.  In fact you should expect just the opposite.  They're going to make assumptions, sometimes recklessly.  You need to follow their reasoning to catch these.  They'll accept highly ambiguous commands and boldly guess at all the ambiguous points.

Despite being computers, their logic is often flawed.  You need to follow their reasoning to catch logical contradictions.  Once you point them out, they excel at fixing them.

The bot's tone is generally optimistic and confident.  Don't let it fool you.  To enhance adoption, it's likely designed for "Performative Positivity."  It's not as smart as it appears to think it is.

Save Your Progress

Like a video game, save your progress frequently.  You may miss one of the bot's many mistakes.  The next mistake could compound the problem.  After several iterations, you've got a bird's nest that is harder to unwind than starting from scratch.  The ability to revert will save time.

Set it Free

When you've asked it to solve a finite problem and it's struggling, it can become tedious to catch each mistake, report it, and repeat.  It's okay to give the bot the means to perform the testing itself.  Provide it acceptance criteria and a means to test, and let it iterate until it thinks it's done.  This'll save you time and toil.  You're like a Product Manager now.  Make sure to UAT.

Don't Get Lazy

The saying is, "A gang is a weapon you trade your mind for."  Don't join the AI gang.  You can't let the bot do your thinking for you.

There's a lot of sloppy code out there that these bots have trained on.  At some point, it'll adopt a sloppy way of doing something.  The same best practices still apply.  If you let the bot set a sloppy precedent, it'll get replicated and magnified.  This about being a good team lead.  Push back when your bot delivers something of low quality.

Agent.md 

When you find you're repeating yourself to the bot, there's a tool for avoiding that, the agent.md file.  Placed at the root directory of the project, by default, the bot will load its content into context and bear its guidance in mind for each action.  Build out the content as you find you need it.  Keep it clean, concise, and human readable just like your code. 

Be Patient

If it were a human being, it'd come off as irresponsibly optimistic, perhaps even dishonest.  It's an amoral statistical engine that's exceedingly good at solving complex math problems with a high number of unknowns.  If it required deterministic input for every problem it'd be unusable.  So it makes guesses.  Remember, it's not a human.  Don't place false expectations on it.

Don't Forget to Script

Many of the tasks you'd like AI to do for you are tedious, repetitive ones.  Like data entry.  Sometimes it does a great job.  Sometimes it struggles at something really simple.  I've asked it to replace all NULLs in a particular column of a data file and it thought for almost a half hour.  In cases like this, you can still write a script to automate your toil away in less time and less cost than using the AI.

If you build up a reusable library for repetitive tasks in a Unix chain-able fashion, you'll almost always be faster than the bot.  If you productionalize them and share them with your team, everyone will be faster than the bot.

 

Comments

Popular posts from this blog

Engineering Truisms

Is it Time to Become an ML Engineer?

The Importance of Pace