Skip to content
OBLAIDISH NEWS
Vibe coding vs spec coding: refund feature built twice
TX_575293Engineering

Vibe coding vs spec coding: refund feature built twice

A Dev.to case study compares AI-generated 'vibe' code with a spec-driven approach for an order-refund endpoint, showing dramatically different bug counts and time-to-stable.

A Dev.to case study shows that building the same order refund API with AI-generated code in ten minutes produced four weeks of production bugs, while a spec-driven prompt took ninety minutes and shipped without incidents [Dev.to]. The AI-generated code yielded a clean-looking RefundController in sixty seconds but omitted idempotency and introduced race conditions, gateway timeouts, and a $230 over-refund on a $200 order [Dev.to]. In contrast, the spec-driven approach defined a state machine, a single-refund-in-process rule, and explicit acceptance criteria, resulting in a single implementation that wrapped the refund logic in a transaction and used SELECT FOR UPDATE for concurrency [Dev.to]. The spec-driven code shipped after about ninety minutes of coding and required zero production patches. The key difference between the two approaches lies in their handling of concurrency safety, with the spec-driven code's transaction-level lock preventing the double-refund race that the vibe patches could not resolve [Dev.to]. The spec's explicit state-machine diagram and acceptance criteria also acted as living documentation, reducing the need for separate unit tests and making onboarding easier for future engineers [Dev.to].

operator_channel
[ comments_offline · provider_not_configured ]
transmission_log

Subscribe to the broadcast.

Daily digest of the day's most important tech news. No fluff. Engineering signal only.

// delivered via substack · double-opt-in confirmation