diff --git a/Code-Style-Guide.md b/Code-Style-Guide.md index 67ed9b6..1dbbd5b 100644 --- a/Code-Style-Guide.md +++ b/Code-Style-Guide.md @@ -32,6 +32,10 @@ Use existing variables whenever possible: * Good: `${PWD}` `${USER}` * Bad: `$(pwd)` `$(whoami)` +When declaring a global variable, be explicit and do it using `typeset -g`. This avoids warnings when `WARN_CREATE_GLOBAL` is set: +* Good: `if (( ! ${+VAR} )) typeset -g VAR=1` +* Bad: `: ${VAR=1}` + Flow logic ----------