question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Only functions names can have verbs (get, set, create, remove)

See original GitHub issue

OK

function getMozzarella() {}
const createPizza = async () => {}


const mozzarella = getMozzarella();
const pizza = await createPizza(mozzarella);

NOT OK

const getMozzarella = await api();
const createPizza = new Pizza();

There are many verbs that should not be part of non-function variables, but I think the most common ones are enough:

get
set
unset
delete
add
remove
destroy

Maybe not:

clear // this is also an adjective
init // this could also be a noun for "initialization of X", a Promise that resolves with X

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fiskercommented, Nov 9, 2021

It’s a good idea, but like impossible to implement without type info.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Newbie's Cheatsheet: Commonly used verbs for naming ...
Newbie's Cheatsheet: Commonly used verbs for naming functions, methods and variables ; 2. Creation · create, 1B, Used when creating a resource.
Read more >
Coding like Shakespeare: Practical Function Naming ...
The method name getAbsoluteDifference() means to get the absolute difference between the pair of numbers. The method name contains a verb get ....
Read more >
Function naming conventions [closed] - Stack Overflow
One of the more universal, yet simple rules is: Function names should be verbs if the function changes the state of the program, ......
Read more >
How to Better Name Your Functions and Variables - Medium
When naming a function, variable or class, you should keep the following things in mind: Choose a word with meaning (provide some context) ......
Read more >
Approved Verbs for PowerShell Commands - Microsoft Learn
For example, always use Remove , never use Delete or Eliminate . Use only the form of each verb that is listed in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found