▶ Sign up free for the video, slides & prompts
The lesson below is open to all. Enter your email once to unlock every video, slide deck, prompt and code example on this device.
Checking…
AI angle: design classes with AI
Brainstorm a class design with AI, then simplify it.
🎬 Video version coming soon — read it now
Designing classes, deciding what becomes a class and what each one is responsible for, is harder than writing them. AI is a good brainstorming partner, but it tends to over-design. Your job is to simplify.
Brainstorm
Expect too much
AI answers often include things like LibraryManager, BookFactory, AbstractUser, Librarian(User), Notification... For a beginner project, most of that is unnecessary.
Ask yourself for each class:
- Does it hold its own data? If not, maybe it's just a function.
- Will there be several of them? One
Libraryobject is fine; a class just to group functions often isn't needed. - Is the inheritance a true "is a"? Or is it there just because it looks professional?
A sensible result
Three small classes. Add more only when a real need appears.
Ask AI to criticise, too
Asking for simpler gives much more useful feedback than asking for "better".
Always run it
Write a few lines that create objects and call each method. If something is awkward to use, the design needs to change, whoever suggested it.
In one line
Use AI to brainstorm class designs, then cut everything that doesn't hold its own data or serve a real need.
Share with a friend