Globally
The exceptions to the camel case rule are username and streamid.
Functions:
Common function uses and names:
Ordering of function names:
Singular or plural:
Variable Names
Input Values:
The exceptions are the variables username, functionName.
Result values:
Result values should be ordered object of interest first and then type. The object
of interest should be singular.
Example: userList, workspaceList
Object names should just use the object word without ‘name’ attached. For example, usernames or workspace names are returned, we shorten to:
userList, workspaceList
If the function returns an array of user names we shorten to object name. For example we return a list of usernames and app names:
[ user, app ]
If we have an array inside an array we will use the object in plural. For example we want to return [user, [app]], we name the return:
[user, apps]
Should it be called a workspace or room?
It should be called a workspace.
Should the first letter if functions be capital (addUser vs AddUser)?
No, it should be addUser.
Should results of arrays be plural (usersList vs. userList)?
No it should be userList.
Should function names be plural (listUsers vs. listUser)?
Yes, it should be listUsers
Result variables should include ‘name’ (e.g. usernameList vs userList)?
No, here we are removing the name and it will be userList. There is one exception and that is username.
Shall we make an exception for username (instead of calling it user)?
Yes, we will make the exception for username.
Should variable names be camel case (userList vs. userlist)?
Yes, it should be userList.
,