What is Vibe Coding?

~
~
Published on
Authors
java-20-banner

What Is Vibe Coding? (And When to Use It)

You’ve seen it on dev Twitter or in Discord: vibe coding.
It’s not a framework. It’s a mode—the creative, exploratory, slightly feral cousin of disciplined engineering.

Definition (No Buzzword Bingo)

Vibe coding is intentionally entering a flow state to discover the shape of a solution.
You code from intuition first, then bring structure in after the spark catches.

Not: cowboy hacking forever.
Yes: prototyping with taste, then cleaning it up.

Why It Works

  • Momentum beats perfection. Empty files don’t ship; prototypes do.
  • Tacit knowledge shows up. You know more than your tickets capture.
  • Nonlinear discovery. Unexpected patterns reveal themselves only once you touch the code.

When to Use It

  • 🧪 Prototyping a new idea (unknown unknowns)
  • 🎨 Creative coding (indie games, generative art, demos)
  • 🧭 Tech spikes (sketch the integration before you spec it)
  • 🧠 Unsticking your brain (context switching back into a codebase)

When Not to Use It

  • 🔒 Safety-critical or compliance-bound code
  • 📉 High-blast-radius changes in mature systems
  • 🧾 Audited paths where traceability is required

The Vibe Loop (A Mini-Framework)

  1. Set the scene (5 min).
    Music on, distractions off, narrow the sandbox: one repo, one branch, one goal.
  2. Constrain the palette (3 choices).
    Pick a stack, a data shape, and a UI/CLI shape. No bikeshedding.
  3. Jam (25–50 min).
    Code the happy path end-to-end—no tests yet, little polish.
  4. Name the insight (2–3 bullets).
    Write findings in a NOTES.md or commit message.
  5. Shape (25–50 min).
    Extract functions, add types, introduce tests around the stabilized shape.
  6. Decide to keep or toss.
    If the spike is promising, ticket the follow-ups. If not, archive and move on.

Tip: Use branch prefixes like spike/ or vibe/ so everyone knows the intent.

Guardrails That Keep It Honest

  • Timer > tunnel vision. Timebox the jam and the shape pass.
  • Thin slice > wide swamp. Walk one vertical path; skip edge cases initially.
  • Snapshots > novels. Keep short commits; write down insights while they’re fresh.
  • Exit ramp > eternal fiddle. Define “good enough to evaluate” before you start.

Anti-Patterns (Don’t Do These)

  • “We’ll harden it later” (but later never comes)
  • Unowned spikes lingering in main
  • Vibes as an excuse to dodge reviews or tests
  • The infinite “just one more tweak” spiral

Vibe Coding vs. Other Modes

ModeGoalWhen to Choose It
VibeDiscover the shapePrototypes, spikes, creative bursts
TDDSpecify the shapeStable domains, regressions, refactors
Design DocAlign on the shapeMulti-team work, high risk, long tail
HackathonShip spectacle fastTime-boxed demos, community energy

They’re complements, not rivals. Great teams swap modes deliberately.

A Tiny Example (From Vibe to Shape)

// vibe: naive event stream deduping by key + minute bucket
type Event = { id: string; ts: number; key: string }

export function dedupe(events: Event[]) {
  const seen = new Set<string>()
  return events.filter((e) => {
    const bucket = Math.floor(e.ts / 60000) // minute
    const k = `${e.key}:${bucket}`
    if (seen.has(k)) return false
    seen.add(k)
    return true
  })
}

Shaping pass ideas:

  • Make the window size configurable
  • Add unit tests with fast clocks
  • Replace minute bucket with a sliding window if needed

TL;DR

Vibe coding is creative first, corrective next. Get the spark; then add the scaffolding. Used intentionally, it’s how prototypes become products—without becoming tech debt skeletons.

FAQ

Isn’t this just cowboy coding?

Only if you skip the shaping pass and guardrails.

What about tests?

Write them after the shape emerges—or for the stabilized core during shaping.