Skip to content

Commit

Permalink
Merge pull request #3434 from 1c-syntax/translations_dbfcc2360538b49f…
Browse files Browse the repository at this point in the history
…3dc1815c351750c2_en

Updates for file docs/diagnostics/DoubleNegatives.md in en
  • Loading branch information
nixel2007 authored Feb 22, 2025
2 parents b7c8e75 + 0f9a61d commit 375e5f3
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion docs/en/diagnostics/DoubleNegatives.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,28 @@
<!-- Блоки выше заполняются автоматически, не трогать -->
## Description

Описание диагностики
Using double negatives makes the code harder to understand and can lead to errors when the developer mentally computes False instead of True, or vice versa.
It is recommended to replace double negatives with conditional expressions that directly express the author's intentions.

## Examples

### Incorrect

```bsl
If Not ValueTable.Find(SearchValue, "Column") <> Undefined Then
// Do the action
EndIf;
```

### Correct

```bsl
If ValueTable.Find(LookupValue, "Column") = Undefined Then
// Perform action
EndIf;
```

## Sources
<!-- Необходимо указывать ссылки на все источники, из которых почерпнута информация для создания диагностики -->

* Source: [Remove double negative](https://www.refactoring.com/catalog/removeDoubleNegative.html)

0 comments on commit 375e5f3

Please sign in to comment.