Improved phrasing
This commit is contained in:
parent
089dcb6a12
commit
fa3916f4c0
1 changed files with 4 additions and 4 deletions
|
@ -332,9 +332,9 @@ return*!*;*/!*
|
|||
So, it effectively becomes an empty return. We should put the value on the same line instead.
|
||||
````
|
||||
|
||||
## Naming a function [#function-naming]
|
||||
## Naming a function #function-naming
|
||||
|
||||
Functions are actions. So their name is usually a verb. It should briefly, but as accurately as possible, describe what the function does, so that someone reading the code gets an indication of what the function does.
|
||||
Functions are actions. So their name is usually a verb. It should be brief, as accurate as possible and describe what the function does, so that someone reading the code gets an indication of what the function does.
|
||||
|
||||
It is a widespread practice to start a function with a verbal prefix which vaguely describes the action. There must be an agreement within the team on the meaning of the prefixes.
|
||||
|
||||
|
@ -376,9 +376,9 @@ These examples assume common meanings of prefixes. What they mean for you is det
|
|||
```smart header="Ultrashort function names"
|
||||
Functions that are used *very often* sometimes have ultrashort names.
|
||||
|
||||
For example, the [jQuery](http://jquery.com) framework defines a function `$`. The [LoDash](http://lodash.com/) library has its core function named `_`.
|
||||
For example, the [jQuery](http://jquery.com) framework defines a function with `$`. The [LoDash](http://lodash.com/) library has its core function named `_`.
|
||||
|
||||
These are exceptions. Generally functions names should be concise, but descriptive.
|
||||
These are exceptions. Generally functions names should be concise and descriptive.
|
||||
```
|
||||
|
||||
## Functions == Comments
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue