Skip to content

Commit

Permalink
Coding Guidelines inconsistencies (#8481)
Browse files Browse the repository at this point in the history
  • Loading branch information
Whigital authored Oct 5, 2021
1 parent cb07e2c commit 6b05da7
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions docs/wiki/development/coding-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -463,17 +463,17 @@ Good:

```js
if (call FUNC(myCondition)) then {
private _areAllAboveTen = true; // <- smallest feasable scope
private _areAllAboveTen = true; // <- smallest feasable scope

{
if (_x >= 10) then {
_areAllAboveTen = false;
};
} forEach _anArray;
{
if (_x >= 10) then {
_areAllAboveTen = false;
};
} forEach _anArray;

if (_areAllAboveTen) then {
hint "all values are above ten!";
};
if (_areAllAboveTen) then {
hint "all values are above ten!";
};
}
```

Expand All @@ -482,15 +482,15 @@ Bad:
```js
private _areAllAboveTen = true; // <- this is bad, because it can be initialized in the if statement
if (call FUNC(myCondition)) then {
{
if (_x >= 10) then {
_areAllAboveTen = false;
};
} forEach _anArray;

if (_areAllAboveTen) then {
hint "all values are above ten!";
};
{
if (_x >= 10) then {
_areAllAboveTen = false;
};
} forEach _anArray;

if (_areAllAboveTen) then {
hint "all values are above ten!";
};
};
```

Expand Down Expand Up @@ -575,8 +575,8 @@ Good:

```js
fnc_example = {
params ["_content"];
hint _content;
params ["_content"];
hint _content;
};
```

Expand Down Expand Up @@ -719,7 +719,7 @@ _a pushBack _value;
Also good:

```js
_a append [1,2,3];
_a append [1, 2, 3];
```

Bad:
Expand Down

0 comments on commit 6b05da7

Please sign in to comment.