-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add guidelines for naming packages #9522
Conversation
|
||
3. Err on the side of clarity, even if clarity seems long-winded to you. | ||
|
||
* If you're aiming to write the definitive Julia tool for data visualization, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DataVisualization
seems like a bad example since we will certainly have multiple visualization packages forever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use Convex as our example, especially after it changed its name from CVX to Convex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for the name change from CVX to Convex was on request from the author of the CVX matlab package, not for increased clarity. I'd also claim that Convex.jl is one particular way to model convex optimization and isn't the "unique source of truth", so I'm not sure it's a good example.
About 2. : Why would the package names need to be plural in general? I think a lot of the names currently aren't. |
@mpastell, it's not that they need to be, but currently (and into the foreseeable future), a package cannot contain a type with the same name as the package. This is because the name of the module itself is included as a constant symbol within the package namespace. julia> module MyTest
end
julia> names(MyTest)
1-element Array{Symbol,1}:
:MyTest
julia> module MyTest
type MyTest end
end
Warning: replacing module MyTest
ERROR: invalid redefinition of constant MyTest So if you want to create a type with the name |
The |
@tkelman, agreed. |
Maybe just reverse the sentence? |
I do think there's something to be said for a consistency principle that keeps most package names plural since that means you don't have to debate when the name shouldn't be plural. Moreover, the phrase |
On one hand we have packages like |
IMHO a policy favoring plural names will lead to some bizarre choices. It's fine to state it as a suggestion, but I would give the package authors some leeway to decide if a plural name really makes sense and is necessary on a case by case basis. |
I've updated the guidelines taking into account the discussion so far. Hopefully some of the new examples are more sensible. |
I thinks thats much better! |
+1 |
The flat package (module) name space will probably get very crowded quickly (are submodules ever distributed separately?). And I suppose it will be common for assumptions about package relations or which application domains will want to use a name to be wrong. Apparently perl has 108K modules . Here is a list of 53K python modules. Will the current scheme of organizing and naming Julia packages have to be changed when there are 10,000 Julia packages ? The relation between packages/modules/name spaces, etc. in a particular language will influence how packages are organized. The first sentence of the van Rossum style guide for naming conventions for Python is "The naming conventions of Python's library are a bit of a mess, so we'll never get this completely consistent..." (but this does not address class hierarchy so much) Here is a proposal for Naming conventions and recipes related to packaging in python. Perl module file names always encode a name space hierarchy. Some python packages do and some don't--- the idea is to avoid unneeded verbosity. Some people say java class names are overly verbose; others say they planned for big growth. Is one of these a good model for Julia ? |
3. Err on the side of clarity, even if clarity seems long-winded to you. | ||
|
||
* ``RandomMatrices`` is a less ambiguous name than ``RndMat`` or ``RMT``, | ||
even if the latter are shorter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"even if" → "even though", since there's no doubt that the latter are shorter.
bump |
No objections here. |
Looks great. |
Add guidelines for naming packages
💯 |
Ref: https://groups.google.com/forum/#!topic/julia-dev/Qw1eaMUKYas (cherry picked from commit b5a3d3d) ref PR #9522 [av skip]
backported in 5c065e7 |
Ref: https://groups.google.com/forum/#!topic/julia-dev/Qw1eaMUKYas
Guidelines courtesy of @johnmyleswhite and @joehuchette