Why are packages labled com.person.mypackage
rather than just person.mypackage
I addition to the answers others have given, consider the large centralized package repositories for software development: npm, PyPI, crates.io, etc. If you frequently publish packages to these indexes, you often will find name collisions and are forced to come up with clever names. In the case of PyPI specifically, it is even worse because while your pip package might be uniquely named, the actual importable python package may not be, and you end up where two pip packages clobber each other. Java’s system is verbose but it is simple and solved this problem decades ago.
fubo@lemmy.world 1 year ago
They used DNS domains as a namespace to keep one company’s work from colliding with another.
en.wikipedia.org/…/Reverse_domain_name_notation
Zephyrix@artemis.camp 1 year ago
To expand on this, it’s the naming convention that Java defines.
https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html
orclev@lemmy.world 1 year ago
Further it isn’t always
com
, you’ll often seenet
,org
, and rarely evenio
show up as the base package. All that said with the introduction of modules and some of the other recent changes I’m not sure how much longer we’re going to see the reversed DNS naming system stick around.