Skip to content

Module naming conventions should allow underscore #1722

Open
@madsoliver

Description

In devdocs Module naming convention it is stated that:

  • Module names should contain only lower case and numbers.
  • Native modules' names must be prefixed with “ps_” (e.g. ps_linklist).

I suggest that the convention instead should be something like:

  • Module names should contain only lower case letter, numbers and underscore.
  • Developers are encouraged to prefix their modules with their own unique prefix, just like prestashop native modules are prefixed with ps_. This makes it easier to avoid conflicts in module name collisions , allowing the merchant to both have (example) modules psdevone_imageslider as well as psdevtwo_imageslider and ps_imageslider.
  • Native modules' names must be prefixed with “ps_” (e.g. ps_linklist).

Why allow underscores?

  • Because not allowing them means developers needs to change the name for hundreds of modules. Myself I have over 100 modules prefixed with "ko_" and most of them also has more underscores like "ko_product_homepage_slider"
  • Because snake-case-names looks better and are much_easier_to_read than notusingunderscoresatall, in file-lists, databases and where ever.

Also discussed on slack

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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