Meteor publications naming convention

Is there a convention for naming publications in Meteor? For instance, meteor-tuts recommends {module}.{submodule[1..n]}?.{action} structure for methods but what about publications? Does anyone know of any style guides which recommends a convention for naming publications?

I’m always going for camelCase naming conventions in my code, just easier to grep and write.

I use the most obvious publications names so I don’t get confused, and so no documentation is needed for other devs.

Name it what it contains - for example ‘usersProfile’ ‘postsHomePage’ ‘searchResults’ and so forth

You can do whatever you want, it’s just down to how you want to remember it.

What it contains may mean different things for different people. You may name it ‘usersProfile’ but I’d name it ‘usersData’. Sure both are pretty telling of what may inside but again it’s not unified nor agreed upon and when you have many developers working on the same project believe you see all types of names and it gets out of hand quickly especially with a large code base!

1 Like

Yeh you gotta be explicit in naming, and no duplicates. Also all publications inside one file only. Then you got it under control.

You gotta get it all in one pub like usersData != usersProfile but if they both contained the contents of the users collection then its just fubar. It’s all about using logical thought to make the minimal required to function correctly. It’s design.

1 Like

You have point but I want to take it further where we have a strict convention that all developers working on a project can agree on.

That’s down to you, in my app no one can add a pub or package without my approval. Depends how you operate. For a open source project you’d just need to have a guide and then review the pr before merging… same methodology really. It’s same for variable naming and file names on my apps. Only I have the final say.

1 Like