Ever been in a situation where you’re having a hard time naming the package of your code? For me it’s always, probably because I do have partial OCD/OCPD (Obsessive Compulsive Personality Disorder)1. Should it be task or tasks? user or users? The decision feels tiny, but you will type that name a thousand times, so it had better feel right.
Anyways, I’ve found this answer before on StackExchange, hopefully it’s still there, and I’m using it ever since in naming my namespaces and packages. It settled the debate with one clean rule.

It’s double the giggles and double the grins and double the trouble if you’re blessed with twins.
~ Anonymous.
Just in case it might get deleted, here is the full answer:
Use the plural for packages with homogeneous contents and the singular for packages with heterogeneous contents.
A class is similar to a database relation. A database relation should be named in the singular as its records are considered to be instances of the relation. The function of a relation is to compose a complex record from simple data.
A package, on the other hand, is not a data abstraction. It assists with organization of code and resolution of naming conflicts. If a package is named in the singular, it doesn’t mean that each member of the package is an instance of the package; it contains related but heterogeneous concepts. If it is named in the plural (as they often are), I would expect that the package contains homogeneous concepts.
For example, a type should be named TaskCollection instead of TasksCollection, as it is a collection containing instances of a Task. A package named com.myproject.task does not mean that each contained class is an instance of a task. There might be a TaskHandler, a TaskFactory, etc. A package named com.myproject.tasks, however, would contain different types that are all tasks: TakeOutGarbageTask, DoTheDishesTask, etc.
Here is the original answer link from Software Engineering StackExchange:
Should package names be singular or plural?
Check the original answer on StackExchange if there is an update.
🧠 Final Thoughts
That rule, “plural for homogeneous contents, singular for heterogeneous,” has answered every naming debate I have had since. tasks holds things that are all tasks; task holds the machinery around a single task concept, handlers, factories, and friends. If the contents share a type, pluralize. If they share a theme, keep it singular.
It is a small rule that makes every future name feel obvious, and for a self-diagnosed naming obsessive, that is worth its weight in caffeine. Thanks for reading!
- Obsessive-compulsive personality disorder (OCPD) is a cluster C personality disorder marked by an excessive need for orderliness, neatness, and perfectionism. Symptoms are usually present by the time a person reaches adulthood, and are visible in a variety of situations. ↩︎
