Skip to content

Towards consistent style, part 1: a naming guide #229

@timholy

Description

@timholy

JuliaImages has grown over several years through the efforts of many people; now that Julia is itself stable, I anticipate new waves of growth in the coming years. To help ensure its health and vibrancy, I think we need to establish some guidelines that will help give such a large, distributed project a unified feel. To me, step 1 of this process is to develop a naming guide and to rename some of our functions or objects accordingly. The sooner we do this the better.

A naming guide should not be arbitrary, but be based on principles. I propose we use this issue to hash out the principles. Here are a few thoughts to get the discussion rolling:

  • maintain consistency with the Julia Style Guide
  • operations whose primary goal is to construct something should be nouns:
    • when the goal is to create a specific type, use the uppercase constructor name (e.g., HOG())
    • when the type created depends on the inputs, use a lowercase function (e.g., colorview)
  • operations that fetch a property or type parameter should be nouns (e.g., axes, eltype)
  • for functions that compute something or perform an operation, start with a verb (e.g., warp)
  • "lazy" computations should use the noun form (e.g., mappedarray rather than maparray)

More examples of current names that are consistent with these guidelines:

Some examples of current names that would change due to these guidelines:

  • imfilter violates the "start with a verb" convention. filterarray, mapstencil (inspired by mapwindow) would both be acceptable
  • imshow->showimage
  • while dilate is good, tophat seems wrong, though I don't immediately have a suggestion as to how to change it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions