From 7069cb82c9bc0d6ab1d6aafeb3eacc7ec1e24a2a Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 23 Feb 2020 02:12:15 +0100 Subject: [PATCH] =?UTF-8?q?Documentation=20-=20Add=20spaces=20between=20ar?= =?UTF-8?q?ray=20elements=20coding=20guidel=E2=80=A6=20(#7524)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/wiki/development/coding-guidelines.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/wiki/development/coding-guidelines.md b/docs/wiki/development/coding-guidelines.md index 9bc536be20..0d2fb64ed3 100644 --- a/docs/wiki/development/coding-guidelines.md +++ b/docs/wiki/development/coding-guidelines.md @@ -397,6 +397,23 @@ Magic numbers are any of the following: [Source](http://en.wikipedia.org/wiki/Magic_number_%28programming%29){:target="_blank"} +### 5.7 Spaces between array elements +When using array notation `[]`, always use a space between elements to improve code readability. + +Good: + +```js +params ["_unit", "_vehicle"]; +private _pos = [0, 0, 0]; +``` + +Bad: + +```js +params ["_unit","_vehicle"]; +private _pos = [0,0,0]; +``` + ## 6. Code Standards