Essential Vibe Coding Tips You Should Learn

Discover practical Vibe Coding tips from Y Combinator to enhance your AI programming skills and project efficiency.

Introduction

Recently, I watched a Y Combinator presentation that introduced their internal Vibe Coding practices, which I found very practical and wanted to share.

What is Y Combinator?

Y Combinator is the most renowned startup incubator in Silicon Valley, having nurtured successful companies like Airbnb, Stripe, and DoorDash.

What is Vibe Coding?

Vibe Coding, literally translated as “vibe programming,” is a new AI programming approach where you can let AI act as your coding assistant, completing most of the coding work while you provide direction, decisions, and feedback.

It is not traditional programming nor simply letting AI write code; rather, it combines intuition, planning, and iteration into a new development method. “Vibe” means going with the flow, quickly experimenting, and continuously adjusting direction; “Coding” refers to rapidly transforming ideas into reality.

Whether validating new ideas from scratch or quickly building internal tools, Vibe Coding significantly enhances speed and quality. Like the rise of prompt engineering a couple of years ago, it continues to evolve with tool advancements and accumulated experiences, leading to new techniques and best practices.

Key Tips for Vibe Coding

  1. Plan Before Coding: Don’t rush to write code. Collaborate with AI to outline a detailed development plan in Markdown. Clearly list features, implementation order, and expected outcomes. Mark what isn’t being done or what might be added later. This plan serves as a compass for development.

  2. Take Small Steps: Develop incrementally. Focus on completing small features and test immediately. Adjust the plan if things don’t seem right. Mark each completed module in the plan. If issues arise, refer back to the plan for clarity.

  3. Version Control with Git: Use Git throughout the process. Start each new feature with a clean codebase. If AI makes a mistake, roll back to the last stable version instead of patching bad code, which can worsen the situation. Reset to a normal version when encountering bugs to maintain code cleanliness.

  4. AI for User Testing: Testing is crucial. Have AI write high-level integration tests that simulate user operations to ensure end-to-end functionality. Don’t just focus on unit tests; the overall process must be smooth. Write tests immediately after completing features to help understand business logic.

  5. AI as a Versatile Assistant: AI can handle many tasks beyond coding, such as configuring DNS, generating icons, and batch processing images, efficiently managing these tedious tasks.

  6. Delegate Bugs to AI: When encountering bugs, provide AI with the error messages; it can usually identify and fix issues quickly. For complex bugs, let AI analyze possible causes. If fixing fails, reset the code and try again to prevent accumulating errors.

  7. Clear and Specific Instructions: Ensure your instructions to AI are clear and specific. Different tools have different formats; you can refer to examples or experiment. Many YC founders write extensive instructions to enhance efficiency. Start with simple commands and gradually refine them to find your style.

  8. Local Documentation for AI: Download relevant documents to your local project folder for AI to read directly. Specify in your instructions for it to reference these documents, which is more stable and accurate than online searches. Local management is simpler and more efficient when document volume is low.

  9. Learn While Coding with AI: Treat AI as a teacher, asking it to explain code line by line, which is an effective way to learn new technologies. This is often more efficient than searching on Stack Overflow. For unfamiliar frameworks, let AI explain the underlying logic to shorten the learning curve.

  10. Start Complex Features with a Demo: For complex features, create a separate project for a small reference implementation or download reference code from GitHub. Then, have AI integrate it into the main project according to this standard, reducing integration difficulty. Remember, small files and modular structures are beneficial for readability and maintenance.

  11. Keep Code Clean and Modular: Maintain modular code and small files for easier maintenance and AI comprehension. A modular architecture clarifies external interfaces and allows internal logic to be adjusted anytime, as long as interfaces and tests pass.

  12. AI Excels with Established Tech Stacks: Experience shows that AI performs best with mature tech stacks, helping you quickly realize ideas.

  13. Screenshots and Voice Input: Screenshots can help AI understand UI issues or find design inspiration. Voice input is efficient, especially during long work sessions. AI is tolerant of minor syntax errors; some tools can even convert voice directly to commands for rapid input.

  14. Run Before Optimizing: Ensure the code runs and tests pass before refactoring. Let AI identify duplicate code or refactoring points to keep files clean and maintainable. Typically, after a phase ends, have AI check the structure to optimize or split modules, ensuring quality and facilitating expansion.

  15. Experiment with New AI Models: AI is evolving rapidly, with new models emerging weekly. It’s advisable to try different models to see which suits specific tasks: some are better for planning, others for implementation or debugging. For instance, Gemini excels in planning, while Claude 3.7 Sonnet is stronger in code implementation; choose according to your needs.

Was this helpful?

Likes and saves are stored in your browser on this device only (local storage) and are not uploaded to our servers.

Comments

Discussion is powered by Giscus (GitHub Discussions). Add repo, repoID, category, and categoryID under [params.comments.giscus] in hugo.toml using the values from the Giscus setup tool.