Skip to content

Commit

Permalink
Don't chain assignments (SAP#219)
Browse files Browse the repository at this point in the history
* Don't chain assignments

* Update CleanABAP.md

* Create typos.yml

* Create .typos-config.toml

* Delete typos.yml

* Delete build.yml

* Create build.yml

* Delete .typos-config.toml

* Create main.yml

* Delete main.yml
  • Loading branch information
lucasborin authored Jul 12, 2021
1 parent bb5d446 commit 29783f4
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions clean-abap/CleanABAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ The [Cheat Sheet](cheat-sheet/CheatSheet.md) is a print-optimized version.
- [Indent and snap to tab](#indent-and-snap-to-tab)
- [Indent in-line declarations like method calls](#indent-in-line-declarations-like-method-calls)
- [Don't align type clauses](#dont-align-type-clauses)
- [Don't chain assignments](#dont-chain-assignments)
- [Testing](#testing)
- [Principles](#principles)
- [Write testable code](#write-testable-code)
Expand Down Expand Up @@ -4082,6 +4083,26 @@ DATA name TYPE seoclsname.
DATA reader TYPE REF TO /clean/reader.
```

### Don't chain assignments

> [Clean ABAP](#clean-abap) > [Content](#content) > [Formatting](#formatting) > [This section](#dont-chain-assignments)
```abap
var2 = var3.
var1 = var3.
```

```abap
var1 = xsdbool( var2 = var3 ).
```

Chained assignments usually confuse the reader. Besides, the inline declaration doesn't work in any position of a multiple assignment.

```abap
" anti-pattern
var1 = var2 = var3.
```

## Testing

> [Clean ABAP](#clean-abap) > [Content](#content) > [This section](#testing)
Expand Down

0 comments on commit 29783f4

Please sign in to comment.