𝗢𝗻𝗲 𝗦𝗶𝗺𝗽𝗹𝗲 𝗡𝗮𝗺𝗶𝗻𝗴 𝗧𝗿𝗶𝗰𝗸 𝗧𝗵𝗮𝘁 𝗦𝘁𝗼𝗽𝘀 𝗖𝗼𝗱𝗲 𝗥𝗼𝘁
Stop naming your classes Service, Manager, or Handler.
These names are vague. They act as permission for bad design.
If you name a class UserService, you can put anything related to a user inside it. You might add password resets, role assignments, and discount calculations. All of these involve a user, so the name feels correct.
But these tasks have different rules and dependencies. A single UserService becomes a giant mess.
Try agentive naming instead. Use names that describe a specific action:
• UserRegistrar • PasswordResetter • RoleAssigner • DiscountCalculator
These names create friction. If a PasswordResetter suddenly needs a tool to generate invoices, the mistake is obvious. The name makes the bad design hard to ignore.
A vague name like UserService is like the "any" type in programming. It accepts everything. Precise names create boundaries.
This matters more now because of AI.
AI coding agents look at your existing code to decide where to put new logic. If you give an AI a UserService, it will add new features to that same messy class. It will do this very fast.
If you give an AI a PasswordResetter, it will stay within that specific boundary.
Your codebase is a prompt for AI. Vague names teach vague design.
Names do not create good architecture. They make bad architecture visible.
Give every responsibility a name precise enough that unrelated code looks dishonest.
Source: https://dev.to/caeus/one-simple-naming-trick-that-keeps-vibe-coded-code-from-rotting-5hf5
Optional learning community: https://t.me/GyaanSetuAi