Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to publish a small open-source library in Java. I wonder what package name should I choose? I'm not a company and I don't have a domain that I could use as the basis for naming the package according to the naming conventions. Still I'd like to somehow follow the naming conventions to prevent an accidental conflict and to keep things standard.

share|improve this question

closed as primarily opinion-based by MichaelT, Bart van Ingen Schenau, Snowman Dec 4 '15 at 22:07

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Go with SOSJP - Small Open-Source Java Project. IF you want to avoid any conflicts, add timestamp to this name - so it will become SOSJP1351952637112. Irony aside, - don't worry about conflicts, you can always rename later. – c69 Nov 3 '12 at 14:24
3  
Invest a few bucks in a domain name? – walrii Nov 3 '12 at 17:14
    
@walrii This somewhat implies keeping the domain alive in the future, which might be inconvenient. – Petr Pudlák Dec 4 '15 at 19:10
    
@PetrPudlák The naming convention is just a suggestion and is not required at all. Personally I've never understood it and always found it weird. Take a stand against it and name your package ppgrphlib for example if it's a graphics or graphing library. No one will ever use that name, so no conflicts will happen. – Brandin Dec 4 '15 at 21:09

Why not make use of your surname? Something like pudlak.project_name.

share|improve this answer
1  
I didn't think of this and it's certainly a valid option satisfying the requirements. But somehow I don't feel comfortable with that, I feel like I'd be promoting myself too much. Also if other people contribute to the library, won't such a name be a bit unfair to them? – Petr Pudlák Nov 3 '12 at 14:20
    
Then drop the surname and just use project_name. – Bernard Nov 3 '12 at 14:49

Your Programmers profile implies that you control petr.pudlak.name, which gives name.pudlak.petr.exampleproject as a possibility.

Another technique to ensure uniqueness is to base it on the means through which the program is distributed to the public. If the username associated with your GitHub repositories is petrpudlak, something like com.github.petrpudlak.exampleproject should avoid collision. The same is true of SourceForge projects: net.sourceforge.exampleproject.

share|improve this answer

If you don't have a domain name, you can still use that naming convention and name it (org\com\net\whatever).projectname. The package name doesn't necessarily need to be the domain name you expect the project to be found at, although it does make things easier. Some projects end up moving domains and don't have their package names renamed for compatibility reasons.

share|improve this answer
    
you certainly ... could do that. but it would be so very silly – naiad Jan 7 '13 at 16:31

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