God Object
ELI5 — The Vibe Check
A god object is a class that knows everything, does everything, and has way too much power — like a single manager running every department of a company. It violates every design principle and makes testing impossible because you can't isolate anything. Usually starts as a reasonable 'Utils' class and grows into a 2,000-line monster that everyone's afraid to touch.
Real Talk
A god object (or god class) is an anti-pattern where a single class accumulates excessive responsibility, knowledge, and coupling to other classes. It violates the Single Responsibility Principle and makes the codebase brittle, untestable, and hard to reason about. Refactoring involves identifying distinct responsibilities and extracting them into focused, cohesive classes.
When You'll Hear This
"The AppController is a god object — it handles routing, auth, logging, AND email." / "Break that god object into at least five classes with clear responsibilities."
Related Terms
Anti-Pattern
Anti-Pattern is the opposite of a design pattern — it's a commonly used approach that looks like it solves a problem but actually makes things worse.
Code Smell
Code that works but feels... wrong. Like when food smells slightly off — it might be fine, but something isn't right.
Refactor
Refactoring is cleaning and reorganizing your code without changing what it does — like tidying your room without throwing anything away.
Single Responsibility
Single Responsibility means every class or function should do ONE thing and do it well.
SOLID (SOLID)
SOLID is five rules for writing code that doesn't turn into a nightmare over time. Each letter stands for a different rule.