📄 Page
1
(This page has no text content)
📄 Page
2
Beyond Vibe Coding From Coder to AI-Era Developer Addy Osmani
📄 Page
3
Beyond Vibe Coding by Addy Osmani Copyright © 2025 Addy Osmani. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 141 Stony Circle, Suite 195, Santa Rosa, CA 95401. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com. Acquisitions Editor: Louise Corrigan Development Editor: Sarah Grey Production Editor: Katherine Tozer Copyeditor: nSight, Inc. Proofreader: Piper Content Partners Indexer: Ellen Troutman-Zaig Interior Designer: David Futato Cover Designer: Susan Brown Cover Illustrator: José Marzan Jr. Interior Illustrator: Kate Dullea August 2025: First Edition
📄 Page
4
Revision History for the First Edition 2025-08-18: First Release See http://oreilly.com/catalog/errata.csp?isbn=9798341634756 for release details. The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Beyond Vibe Coding, the cover image, and related trade dress are trademarks of O’Reilly Media, Inc. The views expressed in this work are those of the author and do not represent the publisher’s views. While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights. This book is not intended as legal advice. Please consult a qualified professional if you require legal advice. 979-8-341-63475-6 LSI
📄 Page
5
Preface We’re in the midst of a profound shift in how software is built. Professional vibe coding—the art of collaborating with AI to create software—is transforming developers from code artisans into product visionaries and orchestrators. Vibe coding is about leveraging AI’s prowess to handle the heavy lifting of coding, allowing developers to focus more on ideas, design, and high-level problem solving. As Andrej Karpathy quipped, it’s like “forget[ting] the code even exists” and simply building—describing what you need and letting the AI fill in the implementation details. This can lead to order-of- magnitude productivity gains, making the mythical “10x engineer” potentially a 100x reality.
📄 Page
6
Who This Book Is For This book is written for three key audiences. The first is experienced developers and engineering leaders who want to multiply their impact. If you’ve been coding for years and feel the weight of repetitive tasks, this book will show you how to delegate the mundane to AI while elevating your role to architect and strategist. You’ll learn to build faster without sacrificing the quality standards you’ve developed over your career. Second, this book serves product-minded engineers who see code as a means to an end rather than an end itself. If you’re frustrated by the gap between having a vision and implementing it, vibe coding can dramatically compress that distance. You’ll discover how to rapidly prototype, iterate, and ship products that would have taken months with traditional approaches. Here’s the most counterintuitive thing I’ve discovered about AI tools: they help experienced developers more than beginners. This seems backward— shouldn’t AI democratize coding? The reality is that AI is like having a very eager junior developer on your team. They can write code quickly, but they need constant supervision and correction. The more you know, the better you can guide them. This creates what I call the knowledge paradox: senior engineers and developers use AI to accelerate what they already know how to do, while juniors try to use it to learn what to do, and the results differ dramatically. I’ve watched senior engineers use AI to: Rapidly prototype ideas they already understand Generate basic implementations they can then refine Explore alternative approaches to known problems Automate routine coding tasks Meanwhile, juniors often:
📄 Page
7
Accept incorrect or outdated solutions Miss critical security and performance considerations Struggle to debug AI-generated code Build fragile systems they don’t fully understand Third, this book addresses engineering managers and CTOs grappling with the implications of AI on their teams and processes. You’ll gain insights into how to structure teams, evaluate talent, and maintain code quality in an era where a single engineer can produce what once required a team. The strategies here will help you navigate the transition while keeping your engineering culture intact. What you won’t find here is a beginner’s guide to programming. While AI makes coding more accessible, wielding it effectively still requires judgment that comes from experience. Think of this book as advanced training for those ready to transcend traditional programming and embrace a new paradigm of software creation. What to Expect This book explores how the role of developers is evolving, from hands-on- keyboard programming to product engineering. This means using human judgment to guide AI, ensuring that quality, architecture, and user needs are met. We still provide the creativity, system thinking, and empathy that turn a functional program into a great product. AI doesn’t replace us; it amplifies us—if we wield it wisely. In Part I, I’ll identify domains where vibe coding excels: spinning up new products, prototyping features, churning out standard CRUD apps or integration code—all areas where speed and pattern matching trump deep originality. Conversely, I’ll also look at where we remain cautious about relying on AI: for truly complex, low-level, or novel algorithms where it might stumble. Recognizing the current limits of AI prevents frustration and failure; there’s still plenty only human ingenuity can achieve.
📄 Page
8
The human element remains the linchpin. We ensure the architecture is sound, debug the tricky bugs, and judge the quality of code beyond “it runs.” Critically, we infuse development with user-centric thinking— something an AI can’t do. It’s up to us to make sure the software not only works but works for the users in a meaningful way. In short, developers become curators and editors of AI output, always aligning it with real-world needs and high standards. Part II looks at the practical aspects of vibe coding. Embracing new workflows is crucial. Techniques like “roll, not fix” remind us not to get bogged down—sometimes regenerating code is faster than debugging it. Parallel prompting lets us solve problems from multiple angles at once. We must balance rapid iteration with eventual refinement, ensuring we don’t accumulate unsustainable mess. Best practices like modularizing AI code, thorough testing, and iterative refinement help keep the codebase clean and robust despite the speed of development. As projects scale, we have to manage an accelerated influx of code and potential technical debt. AI can flood your repo with code; only discipline and good engineering practices (plus maybe AI-assisted refactoring) will keep it maintainable. On the people side, we’ll hire and train engineers to be adept at using AI tools, valuing adaptability and system design skills. And we’ll know when to dial back into traditional modes —like when solidifying a product for long-term maintenance or handling critical systems where caution trumps velocity. Part III covers security and reliability, ethics, and an arsenal of tools that make vibe coding possible today: AI-augmented IDEs like Cursor and Windsurf that integrate models from Anthropic, Google’s Gemini, and OpenAI to understand your entire codebase and assist at every turn. Knowing which tools and models to apply (Claude’s variants for different tasks, ChatGPT for general Q&A) is part of the new developer skill set. They each have strengths: Cursor for interactive editing, Windsurf for context-heavy tasks, chat interfaces for brainstorming and troubleshooting, etc.
📄 Page
9
Looking to the future, I anticipate even more abstract ways of building software (“vibe designing” through GUIs and higher-level input), diminishing reliance on generic libraries as AI generates more bespoke code, and even software that evolves on its own based on AI feedback loops. In this future, success in software will lean heavily on human creativity, distribution savvy, and the ability to harness network effects, because the brute-force barrier of coding will be so low. New user experience paradigms may emerge, driven by AI’s ubiquity—from conversational interfaces to adaptive UIs and beyond. In all of this, one theme stands out: the fusion of human and AI strengths. Neither alone is as powerful as both together. AI brings speed, breadth of knowledge, and tireless execution. Humans bring direction, depth of understanding, and values. The optimal workflow of the future is a symbiosis—think of it as pairing a master craftsperson with a superpowered apprentice who can instantly fetch any tool or reference. The craftsperson’s expertise is still crucial to create something truly excellent. For developers reading this: it’s time to embrace these tools and paradigms. This book will encourage you to experiment with an AI coding assistant on your next project, practice breaking problems down for an AI to solve parts of it, and cultivate that skill of crafting prompts and curating results. But it will also urge you to double down on what makes you uniquely valuable— your ability to design systems, empathize with users, and make judgment calls that align software with reality. Conventions Used in This Book The following typographical conventions are used in this book: Italic Indicates new terms, URLs, email addresses, filenames, and file extensions. Constant width
📄 Page
10
Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords. TIP This element signifies a general note. WARNING This element indicates a warning or caution. O’Reilly Online Learning NOTE For more than 40 years, O’Reilly Media has provided technology and business training, knowledge, and insight to help companies succeed. Our unique network of experts and innovators share their knowledge and expertise through books, articles, and our online learning platform. O’Reilly’s online learning platform gives you on-demand access to live training courses, in-depth learning paths, interactive coding environments, and a vast collection of text and video from O’Reilly and 200+ other publishers. For more information, visit https://oreilly.com. How to Contact Us Please address comments and questions concerning this book to the publisher:
📄 Page
11
O’Reilly Media, Inc. 141 Stony Circle, Suite 195 Santa Rosa, CA 95401 800-889-8969 (in the United States or Canada) 707-827-7019 (international or local) 707-829-0104 (fax) support@oreilly.com https://oreilly.com/about/contact.html We have a web page for this book, where we list errata and any additional information. You can access this page at https://oreil.ly/BeyondVibeCoding. For news and information about our books and courses, visit https://oreilly.com. Find us on LinkedIn: https://linkedin.com/company/oreilly-media. Watch us on YouTube: https://youtube.com/oreillymedia.
📄 Page
12
Part I. Foundations
📄 Page
13
Chapter 1. Introduction: What Is Vibe Coding? AI is reshaping how we build software, introducing new paradigms for coding that range from free-form prompting to structured assistance. Imagine writing software by simply describing what you want it to do— almost like talking to a teammate—while an AI translates those ideas into code. This is the essence of vibe coding, a prompt-first, exploratory approach where you describe what you want in natural language and let a large language model (LLM) fill in the blanks. The term was recently coined by AI pioneer Andrej Karpathy to describe this new way of programming, where developers “fully give in to the vibes” of AI assistance. In this book, I’ll dive deeper into what vibe coding means for professional developers and how it compares with—and complements—what I call AI- assisted engineering, a more formal augmented coding process. I’ll explore how the developer’s role is evolving in this AI-first era, what tools and workflows can maximize your effectiveness, and how to address the unique challenges of letting an AI loose on your codebase. I’ll also look at where vibe coding shines, where it struggles, and how to balance the speed of AI generation with the wisdom of human oversight. By the end, you should have a clear picture of how to harness “the vibes” in your own coding practice—responsibly and effectively—to become not just a faster coder but a more creative and impactful software product engineer in the age of AI. In this chapter, we explore how the role of the developer is transforming from writing detailed instructions for machines to collaborating with AI by expressing intent (see Figure 1-1). We’ll see why this “vibe shift” in programming is such a big deal, how it works at a high level, and what opportunities and challenges it brings.
📄 Page
14
Figure 1-1. A conceptual illustration of programming with intent. The developer provides a high- level specification (the “intent”), and the AI translates it into code. This highlights the shift from writing code line by line to guiding code generation at a high level. The AI Coding Spectrum: From Vibe Coding to AI-Assisted Engineering Over the past year, I’ve observed a fascinating split in how developers— especially intermediate and advanced web developers—embrace AI in their workflow. On one end of the spectrum lies vibe coding. On the other end is what I’ll call AI-assisted engineering: a disciplined method of weaving AI into each phase of software development, from design through testing, under clear constraints. Both approaches leverage powerful AI, but their goals, audiences, and expectations differ markedly. Throughout this book,
📄 Page
15
I’ll explore these two extremes and what they mean for modern web development. The Vibe-Coding Approach: Code by Conversation In vibe coding, you leverage powerful LLMs as coding partners, letting them handle the heavy lifting of code generation so you can focus on higher-level goals. As one Business Insider summary puts it, vibe coding “means using AI tools...for the heavy lifting in coding to quickly build software.” As NVIDIA’s CEO Jensen Huang says, thanks to AI, “the hottest new programming language” is English, not Java or Python. Instead of manually typing out every function and bug fix, you interact with the AI in natural language—sketching out features, reviewing suggestions, and iterating based on the AI’s output. This approach represents a dramatic shift from traditional programming to AI-assisted development. Conventional coding demands careful planning, syntax precision, and often painstaking debugging. Vibe coding flips that script: “It’s not really coding—I just see stuff, say stuff, run stuff, and copy- paste stuff, and it mostly works,” Karpathy quipped to Business Insider, highlighting how AI can turn high-level instructions into working code with minimal manual effort. Developers move from writing detailed instructions for computers to orchestrating outcomes with the help of AI. As an example, Karpathy describes building a web app by continually accepting the AI’s suggestions: “I ‘Accept All’ always, I don’t read the diffs anymore.…When I get error messages, I just copy paste them in.…Sometimes the LLMs can’t fix a bug so I just work around it or ask for random changes until it goes away.” The code “grows” beyond what he’d normally write himself, yet the project comes together quickly through iterative prompting and fixing. Essentially, vibe coding treats coding as an interactive conversation with your AI pair programmer rather than as a solo slog through syntax and stack traces. The goal is speed and exploration—to get a working solution with minimal friction.
📄 Page
16
Several trends converged to make vibe coding possible. First, modern AI coding assistants (like OpenAI’s Codex, ChatGPT, Anthropic’s Claude, etc.) have become astonishingly good at generating and correcting code. In the same post, Karpathy notes this is “possible because the LLMs…are getting too good”—they have ingested vast swaths of GitHub code and can produce plausible solutions for many tasks. Second, new developer tools have emerged to integrate these models seamlessly into the coding workflow (more on these tools in a moment). Finally, the developer community’s mindset is evolving to trust AI assistance for bigger and bigger chunks of work. It’s no longer just autocomplete on steroids; it’s handing over whole functions or files to the AI. In practical terms, vibe coding often feels like having an unlimited supply of eager junior developers to implement whatever you ask for— except they work at the speed of cloud computation. One of the most eye-popping promises of vibe coding is the productivity boost. Early adopters report being able to create software features or prototypes ten to a hundred times faster than before. For instance, Codeium Windsurf engineer John Hoestje muses, “Why be a 10x engineer when you could be a 100x engineer?” This suggests that, with the right AI-powered IDE, extraordinary productivity is within reach. Tools like Windsurf, an AI- enhanced IDE, “can dramatically accelerate development time, allowing you to achieve that 100x productivity.” While 100x might be an extreme scenario, even more conservative studies find huge gains. Developers can generate boilerplate code in seconds, fix bugs in the blink of an eye, and even have AI write tests or docs, compressing workflows that used to take days into mere hours. No longer limited by typing speed or memory, a single developer armed with AI can often prototype a full stack application in a weekend—something that might have taken a small team weeks to accomplish in the past. It’s not just hype either; as I noted in a January 2025 blog post for Pragmatic Engineer, surveys show that 75% of developers have already integrated some form of AI into their workflows, and many companies report double- or triple-digit percentage improvements in development velocity. In short, AI pair programmers are
📄 Page
17
turning the mythical “10x engineer” into a very real (and reachable) 100x engineer phenomenon. To understand how revolutionary this is, consider a concrete example. A developer wants to build a simple web app that counts words in a podcast script and estimates reading time. Instead of starting from scratch, they open an AI-powered coding environment and tell the AI their idea. Within minutes, the AI produces a working prototype. The developer then says, “Make the stats counters bright colors and add a PDF export,” and the AI updates the code accordingly. The result is a functional tool, deployed with one click—all achieved in under 10 minutes. This real-world scenario (reported by a creator using Replit’s AI) shows how vibe coding enables extremely rapid, iterative development driven by high-level requests. Similarly, nonengineers are jumping in: the same article describes one laid- off marketer with no coding background who used an AI coding assistant to build 100 simple web tools that collectively reached the top of Product Hunt. When the barrier to creating software drops this low, we’re not just increasing productivity for seasoned developers —we’re fundamentally expanding who can develop software in the first place. However, vibe coding comes with serious caveats. Because you’re deferring so much to the AI, you might end up with code that “works” in the happy path but hides a minefield of bugs or poor design decisions. Without a solid plan or constraints, an LLM might generate a solution that lacks proper error handling, security checks, or scalability. In fact, AI-generated code can sometimes be built on sand: it appears solid but has hidden issues that only surface under real-world conditions. I’ve seen cases where a developer vibed their way to a complete feature in record time, only to discover later that the code was inefficient and hard to maintain. This kind of “house of cards” code can collapse under pressure. For example, imagine asking an AI to “whip up a user login system.” The AI might produce a working authentication flow quickly, but perhaps it uses a simplified encryption method or a known vulnerable library. If you deploy that without deeper inspection, you’re taking on faith that everything is sound. Seasoned engineers know that’s risky: code running in production
📄 Page
18
has to be understood and trusted. As one expert put it, “Vibe coding your way to a production codebase is clearly risky. Most of the work we do as software engineers involves evolving existing systems, where the quality and understandability of the underlying code is crucial.” Vibe coding, at its extreme, can bypass those quality gates. Another challenge is that vibe coding tends to downplay upfront planning. Traditional software engineering values designing for clarity and constraint- thinking through data models, choosing appropriate patterns, and writing out at least a minimal spec. Vibe coding flips this: it starts with no scaffolding, diving straight into implementation via prompts. That can lead to a meandering development process. You might prompt your way into a corner—say the AI chooses a state management approach or library you didn’t intend, and now you have to either steer it back or live with it. Without an initial blueprint, the final architecture might be haphazard. This is fine for a quick proof of concept, but it’s troublesome in a larger codebase where consistency matters. Vibe coding isn’t inherently “bad.” In fact, its emergence is part of the ongoing democratization of programming. It lowers the barrier to creating software, much like early low-code platforms or scripting languages did. A motivated nonengineer with a clear idea could potentially build a simple app through vibes alone. And for experienced developers, vibe coding can be a powerful brainstorming tool—it’s like pseudo coding but with immediate, runnable results. The key is recognizing its limits. Speed without discipline can lead to brittle software, so vibe coding requires a vigilant human in the loop. I often remind developers (and myself) that “vibe coding is not an excuse for low-quality work.” It should be the start of a solution, not the end. The AI-Assisted Engineering Approach: Structure with an AI Partner On the opposite end of our spectrum is AI-assisted engineering—a more structured, methodical way of building software with AI as a copilot at every step. Here, the developer remains very much in the driver’s seat. AI-
📄 Page
19
assisted engineering includes using AI across the traditional software development lifecycle (SDLC), such as AI-powered autocomplete, chat, code migrations, bug detection, test generation, and both granular (function, module, component) and full code generation (see Figure 1-2). Figure 1-2. The plan-first AI-assisted engineering workflow: developers create specifications, provide targeted prompts to AI systems, review generated code snippets, and integrate approved solutions into their projects.
📄 Page
20
You begin with a plan (even if it’s lightweight), outlining what you need to build and defining the constraints and acceptance criteria up front. Then you incorporate AI tools in a targeted manner to accelerate or enhance parts of that plan. In contrast to prompt-first vibe coding, we might call this “plan-first” development with AI support. This could be as formal as a mini-product requirements document (a short PRD for a feature) or as simple as a checklist of tasks. The crucial difference is that you ground the work in clear intent and constraints before letting the AI loose. Consider a React developer tasked with creating a new interactive dashboard component. In an AI-assisted engineering approach, they might begin by writing down the component’s responsibilities and API: Dashboard component shows a list of analytics cards, supports filtering by date range, and has refresh and export buttons. It should fetch data from our API (with proper error handling), and it must follow our design system for styling. This outline is essentially a spec. The developer might even sketch a quick data model or identify existing utility functions to reuse. Only then do they bring in the AI: for instance, using an AI-enabled IDE or coding assistant to generate the skeleton of the component based on that description. The AI might provide a starting implementation of the React component with placeholders for data fetching and stubbed event handlers. Because the developer provided clear guidance, the AI’s output is more likely to align with the project’s needs (such as using the right design system classes or calling the correct API endpoints). The code isn’t a surprise; it’s the product of a well-formed request. AI-assisted engineering doesn’t stop at code generation for a single component. It permeates the entire development lifecycle in a controlled fashion. For routine coding tasks, an AI autocompletion tool like GitHub Copilot can suggest the next few lines as you type, saving keystrokes when you’re implementing known patterns. For example, as you write a unit test, your AI helper might autosuggest assertions based on the function name. Speaking of tests, you might use AI to generate test cases once a feature is