Building a Geometry Calculator: What AI Got Right, Wrong, and Everything In Between A developer building a geometry calculator with AI assistance found the AI generated clean, working code for happy paths but struggled with edge cases, including triangle inequality validation, dark mode SVG visibility, and input validation. The experience highlighted that AI-assisted development requires human oversight for edge cases and semantic correctness. While working on a collection of browser-based developer tools, I hit an unexpected wall. I needed a geometry calculator — not for myself, mind you, but as one of those "everyone expects it to exist" tools that round out a utility suite. You know the drill: area, perimeter, volume, the usual suspects. The problem? My requirements were deceptively simple. Eight shapes. Dynamic inputs. SVG diagrams. i18n support. Dark mode. I figured this would take an afternoon, tops. Spoiler: it took three sessions with AI assistance, and the journey taught me more about AI-assisted development than any "hello world" tutorial ever could. Let me break down what I thought would be straightforward: Sounds manageable, right? The first prompt I gave to the AI was something like: "Build a geometry calculator with 8 shapes, dynamic inputs, SVG diagrams, i18n, and dark mode. Pure vanilla JS." The AI generated a working version in about 30 seconds. It looked great. It functioned. And then I started testing edge cases. The initial structure was solid. The AI handled the shape selection logic cleanly, and the SVG diagrams were surprisingly good. Here's a snippet of the shape data structure it created: js const SHAPES = { circle: { inputs: 'r' , svg: 'circleSVG' }, triangle: { inputs: 'b', 'h', 'a', 'c' , svg: 'triangleSVG' }, rectangle: { inputs: 'w', 'h' , svg: 'rectSVG' }, // ... more shapes }; This data-driven approach meant adding a new shape was just adding an entry — not rewriting logic. Smart architecture from the start. The formula implementation was also spot-on. For the circle: function circleFormulas r { return { area: Math.PI r r, circumference: 2 Math.PI r }; } Clean. Correct. No surprises. Here's where things got interesting. The first real bug appeared when I tested the triangle with three sides SSS case . The AI had implemented Heron's formula correctly for the area, but the perimeter calculation was... well, it was just the sum of sides. Which is correct, but the AI forgot to handle the case where the triangle inequality is violated. js // AI's initial version function triangleFormulas a, b, c { const s = a + b + c / 2; const area = Math.sqrt s s - a s - b s - c ; return { area, perimeter: a + b + c }; } Try putting in sides 1, 1, and 10. You get NaN for the area, and no warning. A user would be completely confused. The fix required checking the triangle inequality before computing: function isValidTriangle a, b, c { return a + b c && a + c b && b + c a; } This was my first "aha" moment with AI-assisted development: the AI writes beautiful code for happy paths, but edge cases are where you earn your keep as a developer. I mentioned dark mode in my requirements. The AI implemented it using CSS variables with a prefers-color-scheme media query. Perfect approach, right? @media prefers-color-scheme: dark { :root { --bg: 1a1a2e; --text: e2e8f0; / ... / } } But here's what the AI missed: the SVG diagrams. They were hardcoded with dark colors for strokes and labels. In dark mode, they became invisible against the dark background. "Classic 'works on my machine' situation," I muttered, adjusting the SVG colors to use CSS variables: