Volver a la lista de artículos

Vibe Coding Without Programming Knowledge? Why It Could Ruin Your App

Publicado el: 19 de febrero de 2025

4 min de lectura

Confused developer in front of AI-generated code
programming AI best-practices web-development

Vibe Coding Without Programming Knowledge? Why It Could Ruin Your App

Vibe coding has become incredibly popular with the rise of AI tools like GitHub Copilot, ChatGPT, and Amazon Q. The promise is tempting: write what you want and AI generates the code for you. But there’s a critical problem many people ignore.

Warning: This article is not against AI tools. They’re here to stay and are incredibly useful. The problem is using them without understanding what they’re doing.

The Fundamental Problem

Imagine you ask an AI: “Create a function that gets all users from the database”. The AI generates something like this:

async function getAllUsers() {
  const users = await db.users.findMany();
  return users;
}

Looks perfect, right? But here’s the problem: What if you have 100,000 users in your database?

Real Consequences

1. Performance Issues

Without programming knowledge, you won’t know that loading 100,000 records at once:

  • Will consume all your server’s RAM
  • Will freeze your application
  • Could cause your server to crash completely

The correct solution requires pagination:

async function getUsers(page = 1, limit = 50) {
  const skip = (page - 1) * limit;
  const users = await db.users.findMany({
    skip,
    take: limit,
  });
  return users;
}

2. Security Vulnerabilities

AI might generate code vulnerable to SQL injection, XSS, or CSRF. Without knowledge, you won’t be able to identify these risks:

// ❌ VULNERABLE - Generated by AI without validation
app.get('/user/:id', (req, res) => {
  const query = `SELECT * FROM users WHERE id = ${req.params.id}`;
  db.query(query);
});

// ✅ SECURE - With security knowledge
app.get('/user/:id', (req, res) => {
  const id = parseInt(req.params.id);
  if (isNaN(id)) return res.status(400).send('Invalid ID');
  const query = 'SELECT * FROM users WHERE id = ?';
  db.query(query, [id]);
});

3. Massive Technical Debt

AI-generated code without supervision tends to:

  • Duplicate logic unnecessarily
  • Ignore established design patterns
  • Create circular dependencies
  • Not follow project conventions

Why You Need to Know Programming

1. To Ask the Right Questions

An experienced programmer knows to ask:

  • “How do I implement efficient pagination?”
  • “How do I validate and sanitize this input?”
  • “What’s the time complexity of this algorithm?”

A beginner asks:

  • “Give me code to get users”

2. To Review and Optimize

You need to understand:

  • Algorithmic complexity: Is it O(n) or O(n²)?
  • Memory management: Are we creating memory leaks?
  • Design patterns: Does this violate SOLID?
  • Best practices: Is there a more efficient way?

3. To Debug When Something Fails

AI cannot:

  • Debug production errors
  • Understand the full context of your application
  • Identify race conditions
  • Resolve integration issues

The Right Approach

✅ Use AI as a Tool, Not a Substitute

  1. Learn the fundamentals first

    • Data structures
    • Basic algorithms
    • Design patterns
    • SOLID principles
  2. Use AI to accelerate, not replace

    • Generate boilerplate code
    • Get implementation suggestions
    • Speed up repetitive tasks
  3. Always review and understand generated code

    • Read every line
    • Ask “why?” and “what if…?”
    • Refactor according to your project needs

Real Example: Query Optimization

❌ Vibe Coding Without Knowledge

// User asks: "Give me all posts with their authors and comments"
const posts = await db.post.findMany({
  include: {
    author: true,
    comments: {
      include: {
        author: true,
      },
    },
  },
});

Problem: This creates the N+1 problem and can make hundreds of database queries.

✅ With Programming Knowledge

// Optimized with eager loading and pagination
const posts = await db.post.findMany({
  take: 20,
  skip: (page - 1) * 20,
  include: {
    author: {
      select: { id: true, name: true, avatar: true },
    },
    _count: {
      select: { comments: true },
    },
  },
});

// Load comments only when needed

Conclusion

Vibe coding is a powerful tool, but like any tool, you need to know how to use it correctly. Without programming fundamentals:

  • ❌ Your application will be slow and inefficient
  • ❌ You’ll have security vulnerabilities
  • ❌ You’ll accumulate impossible-to-maintain technical debt
  • ❌ You won’t be able to scale your application

The solution is not to avoid AI, but to:

  • ✅ Learn programming fundamentals
  • ✅ Use AI as an assistant, not autopilot
  • ✅ Review, understand, and optimize all generated code
  • ✅ Keep learning and improving your skills

Remember: AI is an incredible tool that can 10x your productivity, but only if you know what you’re doing. There are no shortcuts to fundamental knowledge.

  • Algorithm Fundamentals: Learn Big O notation
  • Design Patterns: Study SOLID and common patterns
  • Web Security: OWASP Top 10
  • Database Optimization: Indexes, efficient queries
  • Testing: Learn to write unit and integration tests

What do you think? Have you experienced problems using AI without solid fundamentals? Share your experience in the comments.