Improved phrasing

This commit is contained in:
Jay 2018-11-09 10:04:30 +01:00 committed by GitHub
parent 089dcb6a12
commit fa3916f4c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -332,9 +332,9 @@ return*!*;*/!*
So, it effectively becomes an empty return. We should put the value on the same line instead. 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. 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" ```smart header="Ultrashort function names"
Functions that are used *very often* sometimes have ultrashort 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 ## Functions == Comments