-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
100% translated source file: 'DoubleNegatives.md' on 'en'.
- Loading branch information
1 parent
7a7ce89
commit 2f5258c
Showing
1 changed file
with
1 addition
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,5 @@ | ||
# Double negatives (DoubleNegatives) | ||
|
||
<!-- Блоки выше заполняются автоматически, не трогать --> | ||
## Description | ||
|
||
Using double negatives complicates the understanding of the code and can lead to errors when instead of truth the developer "in his mind" calculated False, or vice versa. It is recommended to replace double negatives with conditions that directly express the author's intentions. | ||
|
||
## Examples | ||
|
||
### Wrong | ||
|
||
```bsl | ||
If Not ValueTable.Find(ValueToSearch, "Column") <> Undefined Тогда | ||
// Act | ||
EndIf; | ||
``` | ||
|
||
### Correct | ||
|
||
```bsl | ||
If ValueTable.Find(ValueToSearch, "Column") = Undefined Тогда | ||
// Act | ||
EndIf; | ||
``` | ||
|
||
## Sources | ||
|
||
* Источник: [Remove double negative](https://www.refactoring.com/catalog/removeDoubleNegative.html) | ||
* Description |