2

What is the suggested way (specifically in the open-source world) for the package name when porting a library.

Say I am porting someone else's library where they have used a reverse domain name stucture for there package name, so there library package name was some thing like com.therename.thelib. What should I do if I decide to port it to a new language? Should I keep the domain name intact, even though they didn't have a hand in it? Or should I change it to something like com.myname.thelib?

3 Answers 3

4

If you are porting a library to a new language, I would follow the naming conventions commonly used in that new language. This makes it easier for developers used to the conventions of the new language but not the original.

While the reverse domain name pattern is common in Java, for C# Microsoft's naming guidelines suggest something like YourName.TheLibrary or YourName.TechnologyProvidedByYourLibrary (see the article I linked to for details). I suppose there are similar guidelines for other languages as well.

2
  • So you are saying I should change the library package to my own package name if I port something?
    – Adam Harte
    Commented Dec 28, 2011 at 21:59
  • Yes, to comply with the naming guidelines of the new language and to avoid naming conflicts. Commented Dec 29, 2011 at 6:28
1

I would keep it intact so that everyone can clearly see that it's semantically the same.

1

If this is Java, always use reverse-domain with a domain you control. Suppose you keep the name and someone else ports the library, and people create libraries, some depending on your port and some depending on the other port, you could have namespace issues.

That's unlikely to happen, but why risk it?

If you want to maintain the name, contact the domain owners.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.