Elena' s AI Blog

Vibe coding with Generative AI

27 Apr 2025 / 31 minutes to read

Elena Daehnhardt


Elena and silver-color Cyborg code together on a big computer, summer colors, HD --v 6.1, Midjourney April 2025


I’ve been getting into “vibe coding” recently, quickly prototyping some of my ideas, and working on my pet projects. I must confess that the AI-assisted coding is a very addictive activity, and must be taken with caution since it has some security implications and requires a careful prompts engineering.

In this post, I want to share my experiences with some tools I like, discussing their benefits and giving some tips for using generative AI in coding effectively. I have listed several popular AI coding assistants that are very advanced and easy to use.

Introduction

Pair programming with a chatbot might sound like science fiction, but it’s surprisingly effective. Generative AI for coding is a powerful learning experience and a big help with coding/scripting. It is very effective for rapid prototyping/scaffolding and learning to code.

This post covers key AI coding tools, their advantages, and risks, and practical tips to optimise their outputs. We’ll also include a table of prompts for Python web development with Flask and Django since I like them so much :)

AI Coding Companions

AI coding assistants are advanced LLM models that generate code, explain concepts, and identify bugs based on natural language prompts. Using tools such as Gemini Advanced feels like talking with a senior programmer with great experience while communicating patiently and always being available for a friendly chat.

Key Players

There are plenty of coding assistants. Arguably the most notable to date include:

  1. GitHub Copilot integrates with IDEs for real-time code suggestions. Its chat feature allows for conversational interactions.

  2. ChatGPT (the latest models) is widely available and is an excellent tool for generating code, debugging, and suggesting libraries.

  3. Tabnine personalises suggestions based on your coding patterns and can be deployed securely.

  4. Amazon CodeWhisperer provides suggestions within the AWS ecosystem, with a strong focus on security. It is free for personal use.

  5. Google Gemini Code Assist is also free for individuals and integrates with Google Cloud tools for code completion and smart actions.

  6. Gemini Pro and Advanced, Flash 2.0 currently can blow your mind and be the most satisfying prototyping and AI-assisted coding experience, in my humble opinion.

  7. DataLab is an AI-powered data notebook that helps anyone turn data into insights, no matter their skill level. It has a free starting version with limited resources.

  8. Windsurf (previously Codeium) offers AI-assisted coding via coding IDEs or plugins for your IDEs.

  9. Blackbox AI is a fantastic app builder that promises to create applications from your images. You can totally create apps like Uber or Dropbox yourself!

  10. Gpt4all is an open-source tool for running local LLMs on any device.

  11. Tabby helps host AI assistants on your local machine, an open-source alternative to GitHub Copilot.

  12. Codegpt is a development platform that uses AI to assist teams in building, deploying, and managing AI agents for software development.

  13. Replit helps you create apps and websites without coding. Just tell the Replit Agent your app or website idea, and it will build it for you, like having a team of engineers available on demand—all through a simple chat.

The Benefits

The benefits of Integrating AI Coding Assistants into our workflows are endless, and in my opinion, the most apparent benefits include the following:

  • Faster Development: AI automates repetitive coding tasks, accelerating the coding process and boosting productivity, allowing developers to finish projects more quickly. I love AI assistants for creating quick scaffolds and web forms that take user input and store it in databases. I would also like to have a fast draft of the CSS styles.

  • Less Mental Fatigue: AI reduces cognitive load by handling mundane tasks, enabling developers to focus on complex problem-solving and design. I like quickly creating templates and generating data for testing and debugging purposes.

  • Better Code Quality: AI can enhance code by suggesting optimisations and identifying bugs early. However, this depends on careful use and verification to avoid introducing errors. I might caution that sometimes AI assistants generate basic code and require refining your prompts to achieve desired results. Indeed, you have to have an idea about what and how it is to be implemented.

  • Learning Support: AI tools aid learning by explaining code, suggesting libraries, and clarifying programming concepts, making new technologies easier to grasp. If you need to know about the implementation details, different approaches, and some code explanations, AI assistants are the right tool to ask for details.

  • Improved Documentation and Collaboration: AI helps generate documentation and maintain consistent code styles, fostering better teamwork and maintainability. When generating my code with AI, I like to request detailed comments and function docs.

In summary, AI coding assistants empower developers to elevate their focus from basic syntax to strategic decision-making and innovative problem-solving.

The Pitfalls

Despite all the benefits of AI coding assistants, it is crucial to use them with caution, considering the possible challenges and risks as follows:

  • Code Quality Issues: The allure of quickly generated code can create subtle issues. Imagine an AI suggesting a sorting algorithm that works perfectly for small datasets but becomes incredibly slow and inefficient with larger, real-world data. This seemingly functional code could pass initial tests but cripple application performance under load, leading to performance bottlenecks.

    • Possible Solutions:
      • Rigorous Testing: Implement comprehensive unit, integration, and end-to-end testing suites that cover various scenarios, including edge cases and performance benchmarks.
      • Human Code Review: All AI-generated code should be thoroughly reviewed by experienced developers and testers who can identify subtle bugs, logical flaws, and potential inefficiencies.
      • Static Analysis Tools: Employ static analysis tools to automatically scan AI-generated code for potential bugs, security vulnerabilities, and code style violations.
  • Security Vulnerabilities: AI models learn from vast datasets, and if those datasets contain insecure coding patterns, the AI might inadvertently suggest them. For instance, an AI could generate code that directly concatenates user input into an SQL query without proper sanitisation, creating a classic SQL injection vulnerability. Applications become prime targets for malicious attacks if a significant portion of AI-assisted code introduces such flaws.

    • Possible Solutions:
      • Security Training for Developers: Ensure developers understand common security vulnerabilities and how to identify and prevent them, even in AI-generated code.
      • Secure Code Review Practices: Specifically focus code reviews on identifying potential security flaws introduced by AI suggestions.
      • Security Scanning Tools: Utilise specialised security scanning tools (SAST/DAST) to analyse code for known vulnerabilities.
      • AI Model Fine-tuning: Explore the possibility of fine-tuning AI models on secure coding practices and vulnerability-free codebases.
  • Skill Degradation: For less experienced developers, the ease of generating code with AI can hinder the development of fundamental coding skills and problem-solving abilities. If a junior developer consistently relies on AI to write even basic functions, they may struggle to understand the underlying logic, debug issues independently, or design solutions from scratch when AI assistance isn’t available. This dependence can significantly impede their growth and make maintaining or extending AI-assisted code challenging in the long run.

    • Possible Solutions:
      • Guided AI Usage: Encourage junior developers to first attempt coding solutions themselves and use AI as a supplementary tool for suggestions or optimisations, rather than a primary code generator.
      • Focus on Fundamentals: Emphasise learning core programming principles, data structures, algorithms, and design patterns.
      • Mentorship and Knowledge Sharing: Pair junior developers with experienced mentors who can help them understand and debug AI-generated code.
  • Intellectual Property Concerns: The vast datasets AI models are trained on may include code with various licenses. If an AI generates code that closely mirrors a piece of licensed code without proper attribution or adherence to the license terms, it could lead to intellectual property disputes. For example, an AI might generate a specific utility function nearly identical to one found in a GPL-licensed library, potentially creating compliance issues if the project’s licensing is incompatible. Developers must ensure the generated code doesn’t infringe on existing intellectual property rights.

    • Possible Solutions:
      • License Awareness: Educate developers about and respect different software licenses.
      • Code Similarity Detection Tools: Employ tools that can analyse generated code for high degrees of similarity with existing codebases and flag potential IP risks.
      • Careful Prompt Engineering: Craft prompts that guide the AI towards generating original solutions rather than replicating existing code.
      • Thorough Review of Generated Code: Always review AI-generated code to ensure it doesn’t inadvertently incorporate licensed material inappropriately.
  • Contextual Limitations: While AI can generate syntactically correct code snippets, it often lacks a deep understanding of the overall project architecture, business logic, and intricate system interactions. An AI may suggest a perfectly valid piece of code for a specific function, but it could be inappropriate or inefficient within the broader context of the application. This can lead to integration issues, performance bottlenecks, and significant debugging efforts to reconcile the AI-generated code with the rest of the system.

    • Possible Solutions:
      • Detailed Context Provision: Provide the AI with as much relevant context as possible, including project documentation, existing code snippets, and specific requirements.
      • Modular Design Principles: Encourage a modular and well-defined project architecture, which can make it easier for AI to generate contextually relevant code for individual components.
      • Iterative Development and Integration: Integrate AI-generated code incrementally and frequently test its interaction with other parts of the system.
      • Experienced Architect Oversight: Involve experienced software architects in reviewing and guiding the use of AI to ensure its suggestions align with the overall system design.
  • Data Privacy Issues: Many AI coding assistants operate in the cloud, meaning that the code and potentially sensitive data used to generate suggestions are transmitted to and processed on remote servers. This poses significant data privacy risks for projects dealing with proprietary algorithms, confidential business logic, or personally identifiable information. Choosing an AI tool with weak privacy policies or lacking local deployment options could expose sensitive information to unauthorised access or data breaches.

    • Possible Solutions:
      • Prioritise Privacy-Focused Tools: Opt for AI coding assistants that offer strong privacy policies, data encryption, and, ideally, on-premise or local deployment options for sensitive projects.
      • Anonymisation and Redaction: Before using cloud-based AI tools with sensitive code, consider anonymising or redacting confidential information.
      • Review Data Handling Practices: Carefully review any AI coding assistant’s data handling practices and security measures being considered.
      • Legal and Compliance Consultation: Consult with legal and compliance teams to ensure the use of AI coding assistants aligns with relevant data privacy regulations.

AI coding assistants are valuable tools but cannot replace skilled human developers. Human oversight and critical evaluation remain vital in AI-assisted coding.

Mastering Your AI Pair Programmer

Prompt Engineering is Key. The quality of the output you receive heavily depends on the quality of the input (the prompt) you provide. Be Specific, Clear, and Detailed. Vague requests lead to ambiguous or incorrect results.

Clearly define the desired outcome, the context (language, framework, existing code), expected format, length, and even coding style.

Use delimiters like triple quotes (“””) or triple hashes (###) to clearly separate instructions from context or code examples.

Provide Examples (Few-Shot Prompting). Show the AI what you want. Including input and desired output examples is one of the most effective ways to guide the model and resolve ambiguity. I like providing file examples, such as YML structures for AI assistants to start code generation.

Assign a Persona or Role. Instruct the AI to adopt a specific role, like “Act as a senior Python developer specialising in secure API design” or “You are a Flask expert.” This helps tailor the tone, style, and focus of the response.

Break Down Complex Tasks: Don’t ask the AI to build an entire application in one prompt. Decompose large or complex requests into smaller, more manageable steps. Address each step with a focused prompt.

Specify “Do” Instead of “Don’t”. Frame instructions positively. Instead of saying “Don’t use global variables,” try “Refactor this code to avoid using global variables by passing parameters.”.

Iterate and Refine. Prompting is often an iterative process. If the first response isn’t right, analyse why, refine your prompt (make it more specific, add examples, change the persona), and try again.

Use Code-Specific “Leading Words”: For code generation, starting the prompt or the expected output area with relevant keywords (like import for Python and SELECT for SQL) can effectively nudge the model in the right direction.

Best Practices Beyond Prompts

It is essential to treat AI-generated code as untrusted input. As a developer, you are responsible for reviewing code for correctness, efficiency, maintainability, and security. Validate your code using linters, SAST tools, and thorough testing.

Never paste sensitive information, like API keys, into prompts. Also, be aware of your tools’ data usage and privacy policies.

Use tools’ feedback mechanisms to accept or reject suggestions, which helps improve AI models over time. When I like LLMs’ output, I consistently hit the “Like” button to help AI improve.

General coding prompts for learning

Since many of you are learning to code, as I constantly do myself, I am sharing a few coding prompts to get you started,

Beginner Python Explorations

  1. “Hello, You!” Program: Write a script that prompts the user for their name and then prints a personalised greeting like “Hello, [Name]!”.

  2. Simple Arithmetic Playground: Design a calculator that takes two numbers and an operation (+, -, *, /) as input and displays the result. Include error handling for division by zero.

  3. Temperature Tango: Develop a program that allows the user to convert between Celsius and Fahrenheit. Prompt for the temperature and the desired conversion, then output the result.

  4. Number Detective: Create a program that asks the user for a number and tells them if it’s positive, negative, or zero and whether it’s odd or even.

  5. The Guessing Game: The computer picks a secret number between 1 and 100. The player tries to guess it, and the computer provides feedback (“Too high!”, “Too low!”, “You got it!”). Keep track of the number of guesses.

  6. Word Weaver: Write a program that takes a sentence as input and counts the number of words and the number of characters (excluding spaces).

  7. My Little To-Do List: Build a text-based to-do list where users can add tasks, view the current list, and mark tasks as completed.

  8. Roll the Dice!: Simulate rolling one or more dice. Allow the user to specify the number of dice and the number of sides on each die, then display the results.

  9. The Generous Tipper: Create an application that calculates the total bill, including a user-specified tip percentage. Consider adding options to split the bill among multiple people.

  10. Rock, Paper, Scissors Showdown: Implement the classic game against the computer. Keep score and allow the user to play multiple rounds.

Intermediate Python Adventures

  1. Password Powerhouse: Develop a program that generates strong, customisable passwords. Allow the user to specify the length and include/exclude uppercase letters, lowercase letters, numbers, and symbols.

  2. Digital Address Book: Create a contact management system that allows users to add new contacts (name, phone number, email), search for existing contacts, update information, and delete contacts. Store the data in a file.

  3. The Literary Analyser: Write a program that reads a text file and calculates the frequency of each word, ignoring punctuation and case. Display the top N most frequent words.

  4. Decoding Weather Data: Given a CSV file containing weather data (e.g., date, temperature, humidity), write a program to calculate and display statistics like the average temperature, maximum humidity, etc., for a specified period.

  5. Link Shrinker: Build a basic URL shortening service. The program should take a long URL as input and generate a shorter, unique alias. You don’t need to implement actual redirection for this exercise, just the shortening logic.

  6. Hangman: The Graphical Edition: Implement the classic Hangman game, but this time, use a graphical library (like Tkinter or Pygame) to display the hangman figure and the letters guessed.

  7. Web Data Harvester: Create a simple web scraper using a library like requests and Beautiful Soup to extract specific information (e.g., article titles and product prices) from a given website. Be mindful of the website’s terms of service!

  8. Pocket Expense Tracker: Develop an application that allows users to record their expenses, categorise them (e.g., food, transport, entertainment), and view spending by category over a certain period. Store the data in a structured format (like JSON or CSV).

  9. Image Alchemist: Build a program using a library like Pillow (PIL) to perform basic image manipulations such as converting to grayscale, applying a blur filter, resizing, or rotating an image.

  10. The Ultimate Quiz Master: Create a multiple-choice quiz application that reads questions and answers from a file. The program should present questions, accept user input, keep track of the score, and provide feedback at the end.

Advanced Python Quests

  1. Your Personal Finance Hub: Develop a comprehensive dashboard (potentially using a web framework like Flask or Django) that connects to simulated bank APIs (or allows manual input) to track income, expenses, investments, and financial goals. Visualise the data using charts and graphs.

  2. The Intelligent Classifier: Create a program that uses a machine learning library like scikit-learn to build a classifier for a real-world dataset (e.g., spam email detection using text data, sentiment analysis of movie reviews). Include steps for data preprocessing, model training, and evaluation.

  3. Real-Time Communication Channel: Develop a chat application using web sockets (e.g., with libraries like websockets or frameworks like Tornado or Channels) that allows multiple users to connect and exchange messages in real-time.

  4. Building Bridges: A RESTful API: Design and implement a complete RESTful API using Flask or Django REST framework. Include features like user authentication, rate limiting, and CRUD (Create, Read, Update, Delete) operations for a specific resource (e.g., books, products).

  5. The Recommendation Guru: Create a recommendation system that suggests items (e.g., movies, books, products) to users based on their past interactions or preferences. Explore techniques like collaborative filtering or content-based filtering.

  6. The Autonomous Trader: Develop a trading bot that analyses historical market data (e.g., stock prices) and makes simulated trading decisions based on predefined strategies. Consider backtesting the strategy to evaluate their performance.

  7. Understanding Language: An NLP Tool: Build an application that performs a specific natural language processing task, such as summarising a piece of text, extracting key entities, or performing sentiment analysis using libraries like NLTK or spaCy.

  8. Crafting Your Own Data Store: Create a lightweight, file-based database engine that supports basic operations like creating tables, inserting data, querying data based on certain conditions, and potentially indexing.

  9. Orchestrating Tasks: A Distributed Queue: Implement a system for distributing and processing tasks across multiple worker processes or machines. Explore concepts like task queues (e.g., using Redis or RabbitMQ) and worker management.

  10. Seeing the World: A Computer Vision Project: Develop an application that utilises a computer vision library like OpenCV or TensorFlow to perform a task such as object detection, face recognition, or image classification on static images or video streams.

These coding prompts offer more context and potential for expansion, encouraging a deeper exploration of Python’s capabilities. Happy coding!

Python Web Development Prompts (Flask & Django)

Since I like Python coding and web development, I have created table prompts for common tasks encountered in Python web development using the popular Flask and Django frameworks.

Category Task Description Example Prompt (incorporating best practices)
Flask Routing Create a Flask route for a user profile page “Act as a Flask expert. Generate a Python code snippet for a Flask route /user/<username> that retrieves a user object based on the username (assuming a User model exists and is imported) and renders a profile.html template, passing the user object to the template context. Handle the case where the user is not found by returning a 404 error using abort(404).”
Django Models Define a Django model for blog posts “You are a Django developer using Django 4.x. Define a Django model class named BlogPost in models.py. It should include fields for title (CharField, max_length=200, unique=True), content (TextField), pub_date (DateTimeField, auto_now_add=True, help_text=’Date published’), and author (ForeignKey to the standard django.contrib.auth.models.User model, on_delete=models.CASCADE, related_name=’blog_posts’). Include a basic __str__ method that returns the post title.”
Templates (Jinja2) Generate a Jinja2 template loop to display posts “Generate an HTML snippet using Jinja2 templating for a Flask/Django app. Iterate through a context variable named posts (assume each post object in the list has .title, .summary, and .get_absolute_url() attributes). For each post, display the title as an <h3> tag linked to the post’s URL, and its summary as a <p> tag. Enclose each post within a <article class='post-entry'> div.”
Forms (Flask-WTF) Create a Flask-WTF login form “Using Flask-WTF (assume FlaskForm, StringField, PasswordField, SubmitField, DataRequired, Email are imported), create a Python class LoginForm that inherits from FlaskForm. Include fields for email (StringField labeled ‘Email Address’ with validators=) and password (PasswordField labeled ‘Password’ with validators=), and a submit button (SubmitField labeled ‘Log In’).”
Forms (Django Forms) Create a Django contact form “You are a Django forms expert. Create a Django form class named ContactForm in forms.py inheriting from forms.Form. Include fields for name (CharField, max_length=100, required=True), email (EmailField, required=True), and message (CharField with widget=forms.Textarea, required=True).”
Database (SQLAlchemy - Flask) Write a query to get recent users “Act as a SQLAlchemy expert within a Flask application context (assume db session and User model are available). Write a Python code snippet to query the 5 most recently registered users (based on a registration_date DateTime field, descending) marked as is_active=True. Assign the result to a variable recent_active_users.”
Database (Django ORM) Write a Django ORM query to filter active products “Write a Django ORM query within a view function to retrieve all Product objects where the is_active field is True and the price is less than $50.00. Order the results by price in ascending order. Assign the QuerySet to the variable affordable_products. Assume the model Product with is_active (BooleanField) and price (DecimalField) exists.”
Testing (Pytest - Flask/Django) Generate Pytest fixtures for a model “Generate a Pytest fixture function named sample_user using @pytest.fixture (assume pytest is imported). This fixture should create and return an instance of a Django User model (assume User from django.contrib.auth.models is imported) with username ‘testuser’ and password ‘password123’. Ensure the user is saved to the database within the fixture using .save().”
Debugging Explain a Flask traceback “Explain this Python traceback encountered in a Flask application:```. Identify the specific file and line number where the error originated, explain the type of error (e.g., TypeError, KeyError), and suggest 2-3 likely causes or debugging steps to resolve it.”
API Endpoints (Flask) Create a simple Flask REST API endpoint for GET “Create a simple Flask GET API endpoint at /api/items. This endpoint should return a JSON response containing a list of item names: ['item1', 'item2', 'item3']. Use Flask’s jsonify function (assume it’s imported).”
Security Review Identify potential security issues in a Django view “Act as a security-focused code reviewer. Analyse the following Django view function for potential security vulnerabilities such as Cross-Site Scripting (XSS), SQL Injection (if using raw SQL), Cross-Site Request Forgery (CSRF) protection issues, or Insecure Direct Object References (IDOR): python\n[Paste Django View Code Here]\n List any identified potential issues and suggest specific code improvements or standard Django practices to mitigate them.”

How to start

If you are new to AI-assisted programming and prototyping, do not be intimidated by this great choice of tools. You can start by learning with Google Gemini. I recommend this tool due to the fewest issues I have encountered when running the generated code myself. When encountering errors and libraries that are not working together, just copy and paste the error or warning, and the Gemini will come up with possible resolutions.

I felt that Gemini is perfect for learning coding and very quick project scaffolding. I have tried it with Python and JavaScript. I am not a big fan of JavaScript, honestly. However, Gemini was so helpful that I mastered Ajax in a weekend.

Surely, you have to reiterate and think about most of the code design and data structures, and you may have to know what is available and what is really possible. So, it is difficult for me to know for sure how the Gemini would be helpful for a novice. I think that basic knowledge and some coding experience are indeed needed.

If you understand how web applications work well, you will be able to build a simple web app in no time. You will definitely enjoy discussing your ideas with Gemini, as I did. I was really mesmerised and very happy to code with Google’s Gemini, my best pair programmer at the moment.

Surely, chatGPT is another popular choice that could provide a comparable experience. I, however, prefer to use it for content generation and formatting changes, such as creating MarkDown tables or CSS or HTML files.

Tabnine is another excellent tool. I have used it for years as a plugin for PyCharm. It felt like magic, sometimes it however generates the code before you start thinking about what you really want :)

My recommended steps for AI-assisted coding would be to go for your favourite chatbot and try out some prompts. Move to other bots and compare which fits your specific tasks better. Refine your prompts until the desired result. The Generative AI will provide a good starting point for brainstorming your next coding project.

It is not magic. The code is generated so well because the Generative model is trained on a large amount of code developed by many great programmers, which ultimately helps us learn and improve our coding skills.

Conclusion

Working with AI generative assistants like GitHub Copilot, Google Gemini, and Tabnine can significantly improve coding productivity and help users learn new concepts. However, their effectiveness depends on using effective prompts and carefully managing risks, such as potential privacy and security vulnerabilities.

Did you like this post? Please let me know if you have any comments or suggestions.

Posts about development tools and Python coding

desktop bg dark

About Elena

Elena, a PhD in Computer Science, simplifies AI concepts and helps you use machine learning.

Citation
Elena Daehnhardt. (2025) 'Vibe coding with Generative AI', daehnhardt.com, 27 April 2025. Available at: https://daehnhardt.com/blog/2025/04/27/vibe-coding/
All Posts