Skip to content
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

naming convention #32

Open
smeijer opened this issue Jan 22, 2016 · 6 comments
Open

naming convention #32

smeijer opened this issue Jan 22, 2016 · 6 comments

Comments

@smeijer
Copy link

smeijer commented Jan 22, 2016

There is a part written about naming convention for publications:

When naming publications and methods, they should follow this naming convention:

[filename].[name]

For example, if we need to create a method called create inside the posts file, we name it posts.create.

Looking at the sample-blog-app, I can find the publications: posts.list, posts.single and posts.comments. All pretty obvious. But what will the naming convention be for more specific actions. Like publish all posts for one author?

  • posts.by-author
  • posts.list-by-author
  • posts.list_by_author
  • posts.listByAuthor
  • posts.forAuthor
  • posts.list.author

Is there a suggestion for this edge-case? I think my favorite would be posts.list-by-author. (Only not sure if we should do list-by-author or list-for-author. But that's more a grammar thing).

@achtan
Copy link
Contributor

achtan commented Jan 22, 2016

i'am for camelCase so posts.listByAuthor / posts.forAuthor. It's easier to write than other alternatives with -, _ or .

@Hamatek
Copy link

Hamatek commented Jan 22, 2016

camelCase should be the convention for most of the code but publication might use sth like: posts.list.author

@achtan
Copy link
Contributor

achtan commented Jan 22, 2016

why publication should be an exception?

@arunoda
Copy link
Collaborator

arunoda commented Jan 22, 2016

I think camelCase is a good idea. May be we can write it down on the spec too.
Dot should be a separator for namespaces.

@natecox
Copy link

natecox commented Jan 22, 2016

Agreed with camel case for this, it's basically the accepted standard for JS naming.

@zimt28
Copy link

zimt28 commented Feb 29, 2016

camelCase like posts.listByAuthor seems nice, should be added 👍

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

No branches or pull requests

6 participants