-
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.
Merge pull request #3337 from 1c-syntax/translations_dbfcc2360538b49f…
…3dc1815c351750c2_en Updates for file docs/diagnostics/DoubleNegatives.md in en
- Loading branch information
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 |