Nim: [style guide] [low priority] Naming conventions for modules?

Created on 22 Aug 2019  路  3Comments  路  Source: nim-lang/Nim

I noticed in the official style guide/NEP-1 there is no mention of how module names should be written, this should be changed.

Personal opinion: I like snake_case for modules, but compiler/std seems to do nocase

Most helpful comment

furthermore, a soft guideline would be to prefer plural in module name. This is often (but not always) the convention in stdlib, and it's a good one because it reduces name clashes (there are bugs related to this when module name matches proc name), makes things easier to search. eg:

  • oids, cookies, options etc

All 3 comments

We use snake_case too, db_sqlite etc. You're right that the style checker should check this.

furthermore, a soft guideline would be to prefer plural in module name. This is often (but not always) the convention in stdlib, and it's a good one because it reduces name clashes (there are bugs related to this when module name matches proc name), makes things easier to search. eg:

  • oids, cookies, options etc

And also, I suppose preferring nocase, but use snake_case for groups of modules with repetitive/common prefixes (such as db_* as Araq mentioned)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hlaaftana picture hlaaftana  路  3Comments

capocasa picture capocasa  路  3Comments

ghost picture ghost  路  4Comments

SolitudeSF picture SolitudeSF  路  3Comments

juancarlospaco picture juancarlospaco  路  3Comments