Vibe coding
Vibe coding is an approach to producing software by using artificial intelligence (AI), where a person describes a problem in a few natural language sentences as a prompt to a large language model (LLM) tuned for coding. The LLM generates software based on the description, shifting the programmer's role from manual coding to guiding, testing, and refining the AI-generated source code.
Advocates of vibe coding say that it allows even amateur programmers to produce software without the extensive training and skills required for software engineering. Critics point out a lack of accountability and increased risk of introducing security vulnerabilities in the resulting software. The term was introduced by Andrej Karpathy in February 2025 and listed in the Merriam-Webster Dictionary the following month as a "slang & trending" noun.
Prompt: Write JavaScript code to estimate Pi using the Monte Carlo method.
ChatGPT: Here's a concise JavaScript implementation of estimating π using the Monte Carlo method:
function estimatePi(numSamples) { let insideCircle = 0; for (let i = 0; i < numSamples; i++) { const x = Math.random(); const y = Math.random(); if (x * x + y * y <= 1) { insideCircle++; } } return (insideCircle / numSamples) * 4; } // Example usage const samples = 1_000_000; console.log(`Estimated Pi: ${estimatePi(samples)}`);This method generates numSamples random points in the unit square and counts how many fall within the unit quarter-circle. The ratio approximates π/4. Would you like a version with a visual plot (e.g., using HTML canvas)?