Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AI Love Design Patterns (Too Much)

AI Love Design Patterns (Too Much)

You know design patterns: Factory, Builder, Decorator, Strategy. They're powerful tools for solving specific problems. But here's the thing: AI coding tools absolutely love them. Like, really love them. They'll add a Factory pattern to create a single object. They'll wrap simple conditionals in a Strategy pattern when an if/else would work perfectly. They'll build a Builder for a class with three parameters.

This talk is an intervention. We'll examine real examples of AI-generated code where patterns were applied incorrectly, unnecessarily, or just plain weirdly. You'll learn to spot the red flags that signal pattern misuse, understand when AI's pattern suggestions are actually useful (they're not always wrong!), and discover how to prompt AI effectively to avoid the pattern addiction. Because sometimes the best pattern is no pattern at all.

Avatar for Christine

Christine

July 24, 2026

More Decks by Christine

Other Decks in Technology

Transcript

  1. NEBRASKA.CODE() 2026 AI Loves Design Patterns (Too Much) at bo

    ten ci & re r y e v o c n o t i d d a y r o t t c a e p d t d u a e a h k t l o a 25-min Spotlight · Intermediate · Software Craftsmanship × AI Yes, it d an r Fa r
  2. A I Di s c l a i m er

    1 These slides was designed with Claude Design 2 This talk is about AI generated code...that was generated with Co-pilot and Claude. 3 Idea, wording and research is my own, with full references provided. w o h e h t t w On i h s →
  3. E X H I BI T A · G E

    N ER AT E D BY A I "Create a user." ←I as f u r at . I go n es. Se m ke A or tom n l r i a f e s i t e d t e d p p t e r a y t r s a w n p t e i t i n s l o S o i i e s b l p o p y r e r r c e u e o e o r l e r n s C d a e n I t r t o o r a a h f d t y y i e l r r k a s l n i i p s s e o o p p u Uh, is 't e EF r 's D e l a y re to p r , so C ot p a re to r u y ep or ?? -im m ad h s at s
  4. E X H I BI T A · G E

    N ER AT E D BY A I "Create a user."
  5. "The genie seems to assume that its planetary-sized brain is

    capable of handling any amount of complexity, so it needn't ever reduce complexity." c e B t — Ken k
  6. Why AI Has a Pattern Addiction 01 Un e s

    d o t d o p s s u s l e h u a c h g n i n a t r d SECTION ONE OF FIVE t e se p re n it.
  7. T H E DI A G N OS I S

    Pattern addiction, defined 1 AI is trained on code, "good code" 2 Patterns signal intent in ambiguous prompts 3 The addiction compounds: your codebase is part of the prompt. a i l m a d n u so f i r? →
  8. “ The probability that AI gets something wrong can increase

    with a bad codebase, because it will pick up on existing patterns. r o d n o L C e l k a t i g — Bir t Böc e r, Q on n, Ap 2026
  9. A 2026 study of Cursor-generated projects found 91% average functional

    correctness BUT.... alongside 1,305 CodeScene and 3,193 SonarQube design issues across 10 projects Correctness benchmarks can hide design quality GitClear's multi-year study of 211M changed lines found copy-paste code rose from 8.3% to 12.3% while refactoring commits fell from 25% to under 10% as AI assistance grew via freeCodeCamp, Apr 2026 The tools add structure; nobody goes back to simplify it.
  10. 02 s e l m x e e s c

    o e r h SECTION TWO OF FIVE The Pattern Gallery of Shame t e f u d a p
  11. E x a m p l e 1 · G

    E N ER AT E D BY A I Pro t: "Set We m t po Factory for a Single Object ← One is lu ba c n oy s r l w e ca s ra s t et . e s a p d b o s e n l r i n t r a o d a f o r s e c t e e l a e m r s a u s r r s e l e n h p t a o b d h e t r a i r n p h s r y u a p s u s e y s a s d c a c y e h l g o p i a t c m r A fa Use ro s . h o mi t r e to . ro l e ."
  12. E x a m p l e 1 · G

    E N ER AT E D BY A I Factory for a Single Object d o t e n r r m i e t t a s a e r l s c b e l t e a s e u r r y e n a h s h o d t d a s r a p s u a r p c u a s y r o e h t g s p i c m A fa r l w e ca s h on U l e y si t . Pro t: "Set We m t po mi t r e to . ro l e ."
  13. E x a m p l e 2 · G

    E N ER AT E D BY A I t i l t i m e i e h t s r i r t s s e r l e s u r o s e w t p o e r e l p i d x y l Strategy for a Two-Branch Conditional The m : "Let s ot te s b at , ne t o d f t. Ke p f e b ."
  14. ← ad f r i a h b e o

    e t z n d u n e t t a t y d r s y i p g g a e e w a r r t d e S v n a t e e r s s a s r c c r j a u r o o a p s y g d e r t ← Com la s to IS he ar t , an r e vo s at be t ne s pe t r pa r . im
  15. t r w e t s .reversed() do e d

    o h e m h y l a Re l t e h o k.
  16. S I DE BY S I DE What it wrote

    vs. what you needed WHAT AI WROTE ✗ Comparator IS the Strategy pattern. It has shipped with the JDK since 1998. The AI wrapped a strategy in a Strategy. ✗ The abstraction adds four classes and a registry, and zero behavior ✗ The strategies are never swapped at runtime; the call site knew the direction all along. WHAT YOU NEEDED ✓ One interface. Two classes. An enum. A registry. Really the method .reversed() does the work.
  17. E X A M P L E 3 · G

    E N ER AT E D BY A I Builder for Three Parameters ul on s bu , to 🤷 ob c il es se ne f u to ← Not g o t a , t e r s al -bu ca The p o p : "Ad a R r it ti , da , an n . Mak ce n a n i b ." Com an e d o l i d n r i e e h p a r t m o o g i y e l n h o t c e l j b a o a l t k n i i n o a e e d h a e u y m w w i o e r l h t e n r h v e t o a l r p n a e n l w a a o n o i t l t i s o l p i t d i i i d d s f e t i m e n g e d n h h t f i s t h t a a r i e l x e e i r n e p d m e l a i d n t r l Bu l s i , fa t u t r to sin t a s ye r
  18. E X A M P L E 3 · G

    E N ER AT E D BY A I Builder for Three Parameters The m : "Ad a R r it da , an n . Mak le ma in ." t l a u l i t n a i a t e h c n u a l w t e t c s n t o i o p e c e u o y y t i d i r e b v i e l w g t t o b u p a d r o o m r a i c t p e n d i t A re d es an m a l d t e, on r on, eq i y, in in .
  19. 03 When Patterns Actually Help + A Red-Flag Checklist A

    qu d a s pa r de to l d a r e n I n i g m e r o b y p p a c i t o n g o i c n k c i e t t SECTION THREE OF FIVE ef er g A -ge te
  20. As k you r s e l f Quick diagnostic

    to apply before merging AI-generated pattern code 1 Is there more than one implementation today, or a realistic reason to expect one? 2 Does removing the pattern eliminate complexity without eliminating capability? 3 Would a new dev need to look this pattern up to understand it? 4 Did the AI add the pattern without being asked?
  21. T H E P L OT T WI S T

    "Wa t — t i t he St a g t e n ac l ig ." It's not always wrong. When there are genuinely many variants t e k s el t if n e. Know when it is just "Speculative Generality" happening. c e r e f d e h t s i e g n m r i i l t t s t h a h p i r y l l y i e l t a s i u r t h image from shutterstock
  22. 04 Prompting for Simplicity Th e r ic en er

    . r e v m o f y a I r e e t t s p m o p l a t g c a n i p e e n i r g SECTION FOUR OF FIVE t os A aw r o r-
  23. T H E R EC OV ERY P L A

    N How to prompt for restraint during · Split Before · CONSTRAIN → "Simplest thing that works. No new abstractions." Get a patternless baseline first, then make the abstraction call a separate step → y f i p n o m i t o c x t e n e a t t o y o d t u n a f i t d e e v t n y i g c n l i m o i c s t e ? l a t w u s Wha d co n o p e h o n , l e h pi t Mak After · Interrogate "Why is there a Factory here? What problem does it solve?"
  24. The Best Pattern Is the One You Can Delete 05

    Pat n s e u r t y r a b a c o r a s r e t SECTION FIVE OF FIVE ev ul , no l .
  25. THANKS, NEBRASKA.CODE()! Go write less code . 1 · A

    pattern is a tool, not a reflex. Q&A 2 · Make the AI justify the abstraction. w a 's e w es pa r u've ca t A a n ? 3 · The best pattern is often no pattern. t g d i r i d e d o I h y t n e h t t g t u h @[email protected] · references: christine-seeman.com/ai-patterns