When I create a stand-alone Java program, which only has one or two java/class files and is not shared with other programs, I never take the time to say org.domain.scripts.purpose
in the package name. I typically just make my main class main.Main
.
Perhaps this is against protocol, but when duplicating a program in order to fill another small niche requirement (like converting tab delimited to csv or recursively listing files sorted by modify date), I will not be made to rename the package name or to suffer through long package names and paths when I already know what program I am in.
Also little generic classes (like Base64 conversion) are easier to copy from one program to another when they do not have unique package names.
So, what would be a standard generic package name (or is there one)
Edit: I suppose I will go ahead and mention some more reasons. It is easier to diff files or to see if they are identical when they have the same package name. Also, when I need a library to be included, I make a usage note that includes java -cp library:jarfile
instead of java -jar
and the cp option requires I set the main class name, so I like to have it short there too. Also the stack traces look better that way.