alguidelines/content/docs/BestPractices/unnecessary-truefalse/index.md
2022-05-05 16:16:27 +00:00

38 lines
508 B
Markdown

---
title: "Unnecessary true/false"
tags: ["AL","Readability"]
categories: ["Best Practice"]
---
_Created by Microsoft, Described by waldo_
## Description
Do not use `true` or `false` keywords unnecessarily if the expression is already an logical expression.
## Example 1
### Bad code
```al
if IsPositive() = true then
```
### Good code
```al
if IsPositive() then
```
## Example 2
### Bad code
```al
if Complete <> true then
```
### Good code
```al
if not Complete then
```