mirror of
https://github.com/google/styleguide.git
synced 2024-03-22 13:11:43 +08:00
Merge pull request #534 from google/change_HEAD
Project import generated by Copybara.
This commit is contained in:
commit
250bd6a4b0
|
@ -758,6 +758,7 @@ removed `./somefile'
|
||||||
|
|
||||||
`eval` should be avoided.
|
`eval` should be avoided.
|
||||||
|
|
||||||
|
|
||||||
Eval munges the input when used for assignment to variables and can
|
Eval munges the input when used for assignment to variables and can
|
||||||
set variables without making it possible to check what those variables
|
set variables without making it possible to check what those variables
|
||||||
were.
|
were.
|
||||||
|
@ -1146,15 +1147,13 @@ my_func2() {
|
||||||
### Function Location
|
### Function Location
|
||||||
|
|
||||||
Put all functions together in the file just below constants. Don't hide
|
Put all functions together in the file just below constants. Don't hide
|
||||||
executable code between functions.
|
executable code between functions. Doing so makes the code difficult to follow
|
||||||
|
and results in nasty surprises when debugging.
|
||||||
|
|
||||||
If you've got functions, put them all together near the top of the
|
If you've got functions, put them all together near the top of the
|
||||||
file. Only includes, `set` statements and setting constants
|
file. Only includes, `set` statements and setting constants
|
||||||
may be done before declaring functions.
|
may be done before declaring functions.
|
||||||
|
|
||||||
Don't hide executable code between functions. Doing so makes the code
|
|
||||||
difficult to follow and results in nasty surprises when debugging.
|
|
||||||
|
|
||||||
<a id="s7.8-main"></a>
|
<a id="s7.8-main"></a>
|
||||||
|
|
||||||
### main
|
### main
|
||||||
|
|
Loading…
Reference in New Issue
Block a user