Stats 21 - vibe coding
Overview
Miles Chen explains a practical workflow for vibe coding: ask an AI to surface design decisions before requesting implementation, then review and test the result. He demonstrates the process by planning and building a Python Connect Four game with Tkinter and Pillow, and recommends a second AI review to challenge assumptions, especially in data analysis where mistakes can produce plausible but incorrect numbers.
Key takeaways
- Before asking an AI to build a project, ask it to identify the relevant design decisions, questions, and recommended choices so the user stays in control of important requirements.
- In data analysis, missing values can encode meaningful circumstances: a scale error above a 250-pound limit should not automatically be replaced with the average.
- A plausible numerical result is not proof of correct analysis; make assumptions, data-cleaning choices, and anomaly handling explicit before interpreting results.
- A concrete Connect Four specification included Tkinter, four modular Python files, 7-by-6 classic rules, two game modes, and different undo behavior for human-versus-AI and two-player games.
- Testing generated code by running it and exercising features such as piece drops, win detection, mode switching, and undo helps expose issues that a prompt or code review alone may miss.
- A second AI chat can serve as an independent reviewer when given a summary of the first chat's decisions and asked to challenge them for risks and overlooked edge cases.
Chapters
- Miles Chen says every final exam question will come from a posted pool of more than 100 questions.
- The exam will use about 40 pool questions, and answer choices may be shuffled.
- Students receive the full three hours, though Chen expects the exam may take less time.
- UCLA students should sign in to Gemini with their g.ucla.edu account to access the education offering.
- Chen describes Gemini Education models named Hydrogen and Neon, recommending medium effort for routine responses and higher effort for more thorough work.
- He notes that AI models and subscription tiers change frequently, so available options may differ over time.
- AI assistants work better with specific instructions, but users may not know which requirements need to be specified.
- Before requesting a solution, ask the AI to list the decisions and questions that will shape the project, along with recommended options.
- If the user leaves choices unspecified, the AI generally makes them independently, which can produce results that do not match the intended outcome.
- A vague request to analyze a data file leaves the AI to choose methods and assumptions without necessarily understanding the data's context.
- Chen's scale example shows why missing values can be informative: a scale that maxes out at 250 pounds may record an error for heavier people.
- Replacing those missing weights with the mean could systematically produce wrong results, even though the output looks plausible.
- Chen asks Gemini to plan a Python Connect Four game and explicitly says not to begin coding until it has presented design questions and recommendations.
- The chosen plan uses Tkinter, a modular four-file structure, classic 7-by-6 rules, local two-player and player-versus-AI modes, and a simple rule-based AI.
- Other decisions include alternating the starting player on rematches, a live-session scoreboard, a hover indicator, animated drops, and highlighting the four winning discs.
- Undo should reverse two moves against the AI, one move in two-player mode, and be disabled after game over.
- After confirming additional rendering and game-state choices, Chen asks Gemini to implement the game as four files: engine.py, ai.py, ui.py, and main.py.
- The implementation uses Tkinter with Pillow for board rendering, and Chen saves the generated files into a Connect Four project folder.
- He activates his virtual environment in a terminal and runs main.py to check whether the program launches and responds.
- The game opens with player-versus-AI mode, a 7-by-6 board, red human pieces, and yellow AI pieces.
- Chen tests dropping pieces, observes the AI respond, and confirms that the game detects a winning run and highlights five connected discs in his playthrough.
- He also checks local two-player mode and the undo control, using direct interaction to verify the generated application.
- Chen recommends summarizing the first AI conversation's design decisions and pasting them into a fresh chat for an independent critique.
- The second AI is asked to identify potential problems or overlooked edge cases, rather than simply approve the plan.
- For data analysis, ask explicitly what assumptions the AI made and what decisions are needed for cleaning data before analysis begins.
- Chen closes by encouraging students to try small projects and ask the AI to explain the code it generated.
Transcript excerpt
0:02 H. Okay. I think I hope this is working. Test test test. Okay. Good. Okay. Uh let's talk about the final exam. I have posted a pool of questions. It's it's a lot of questions. Okay. Um but this will be it. This every single question that will be on the final is in this pool here. Okay. There will be no surprises. There's a lot of questions. There's like over a hundred here. Okay. Um but what do we have to
0:51 know? It's the stuff in here. Okay. And uh that's that. So, um yeah, I will just copy and paste maybe uh around 40 40 of these questions, okay? Put them into the the final exam and and that will be it. Maybe I'll shuffle up the answer choices, okay? So, you can't just memorize like, oh, this question is C and that question is D. Although, I think that's like harder to remember. Um so but if you if you learn all of this and you understand what what uh what each one's output and stuff then you will be set. Okay. So that will
1:40 be it. Uh yeah no surprises. Um that will that's that is the entire little questions. Um and that's that. Okay. Um, I don't know if there's any questions regarding the final other than that. Um, that's Yes, >> we get the full three hours. >> You will get the full three hours. Uh, yeah, I imagine it won't take the full three hours, but you'll get the full three hours. Yeah. So, okay. All right. So this next part I haven't planned. I mean I have I have an idea in my mind but I haven't tested anything out. I want to just kind of
2:29 guide you through how do we
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Miles Chen.