Skip to content

Instantly share code, notes, and snippets.

@martinbean
Created November 28, 2012 15:36
Show Gist options
  • Save martinbean/4162031 to your computer and use it in GitHub Desktop.
Save martinbean/4162031 to your computer and use it in GitHub Desktop.
Martin’s fantastic naming convention document

Martin’s fantastic naming convention document

Controllers: plural

  • For example: UsersControllers

Models: singular

  • A model representes one item, i.e. a record from a database. So: User or UserModel.

On the flip side, if you build models with some sort of factory, then the factory name should be plural, i.e. UsersFactory.

Database tables: plural

  • Database tables hold multiple records. Therefore, you have a table of users, and not a table of user. It makes sense for the table name to then be plural.

As with everything programming–related, this is merely my personal preference. Don’t agree with something above? I’d love to hear why in the comments, as well as your own personal naming conventions.

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