-
Notifications
You must be signed in to change notification settings - Fork 37
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
Precise event naming convention #14
Conversation
README.md
Outdated
|
||
Events should track things that _happened_ and so should be past tense. Using past tense also helps avoid naming collisions with structs or functions. | ||
Events should track things that _happened_ and so should be past tense. Using past tense also helps avoid naming collisions with structs or functions. We also recommend following the `WhatAction`(e.g. `OwnerUpdated`) format rather than `ActionWhat` (e.g. `UpdatedOwner`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe more clear to use parts of speech naming?
Events should track things that _happened_ and so should be past tense. Using past tense also helps avoid naming collisions with structs or functions. We also recommend following the `WhatAction`(e.g. `OwnerUpdated`) format rather than `ActionWhat` (e.g. `UpdatedOwner`). | |
Events should track things that _happened_ and so should be past tense. Using past tense also helps avoid naming collisions with structs or functions. We also recommend following the `SubjectVerb`(e.g. `OwnerUpdated`) format rather than `VerbSubject` (e.g. `UpdatedOwner`). |
+1 to this! |
README.md
Outdated
|
||
Events should track things that _happened_ and so should be past tense. Using past tense also helps avoid naming collisions with structs or functions. | ||
Events should track things that _happened_ and so should be past tense. Using past tense also helps avoid naming collisions with structs or functions. We also recommend following the `SubjectVerb`(e.g. `OwnerUpdated`) format rather than `VerbSubject` (e.g. `UpdatedOwner`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @xenoliss one more comment here. I think We also recommend...
could be its own rule? Not sure we need to bundle with past tense
README.md
Outdated
event OwnerUpdated(address newOwner); | ||
``` | ||
|
||
##### B. Prefer `SubjectVerb` naming format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
##### B. Prefer `SubjectVerb` naming format | |
##### B. Prefer `SubjectVerb` naming format. |
In addition to recommending the usage of past tense for events naming, this PR further advise to follow a
WhatAction
(e.g.OwnerUpdated
) format rather thanActionWhat
(e.g.UpdatedOwner
).