prefix? + action (A) + high context (HC) + low context? (LC)
Take a look at how this pattern may be applied in the table below.
| Name | Prefix | Action (A) | High context (HC) | Low context (LC) |
|---|---|---|---|---|
getUser | get | User | ||
getUserMessages | get | User | Messages | |
handleClickOutside | handle | Click | Outside | |
shouldDisplayMessage | should | Display | Message |
Note: The order of context affects the meaning of a variable. For example,
shouldUpdateComponentmeans you are about to update a component, whileshouldComponentUpdatetells you that component will update on itself, and you are but controlling when it should be updated.
In other words, high context emphasizes the meaning of a variable.
Loading...
You can useSee also compose.
get when performing asynchronous operations as well:
Loading...
A to value B.
Loading...
Loading...
removeFilter, not deleteFilter (and this is how you would naturally say it in English as well):
Loading...
See also delete.
deletePost action, not removePost.
Loading...
See also remove.
removeordelete?When the difference between
removeanddeleteis not so obvious to you, I'd sugguest looking at their opposite actions -addandcreate.
The key difference betweenaddandcreateis thataddneeds a destination whilecreaterequires no destination. Youaddan item to somewhere, but you don't "createit to somewhere".
Simply pairremovewithaddanddeletewithcreate.Explained in detail here.
Loading...
See also get.
Loading...
Loading...
Some language-specific assumptions may allow omitting the context. For example, in JavaScript, it's common that
filteroperates on Array. Adding explicitfilterArraywould be unnecessary.