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,
shouldUpdateComponent
means you are about to update a component, whileshouldComponentUpdate
tells 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.
remove
ordelete
?When the difference between
remove
anddelete
is not so obvious to you, I'd sugguest looking at their opposite actions -add
andcreate
.
The key difference betweenadd
andcreate
is thatadd
needs a destination whilecreate
requires no destination. Youadd
an item to somewhere, but you don't "create
it to somewhere".
Simply pairremove
withadd
anddelete
withcreate
.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
filter
operates on Array. Adding explicitfilterArray
would be unnecessary.