alguidelines/content/docs/BestPractices/unnecessary-truefalse/index.md
Henrik Helgesen fb17dc9640 Removed Discussion Links. Using new Theme solution.
Some additional MDLint cleanup as well
2022-02-24 15:36:06 -08:00

34 lines
476 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.
## Bad code
```al
if IsPositive() = true then
```
## Good code
```al
if IsPositive() then
```
## Bad code
```al
if Complete <> true then
```
## Good code
```al
if not Complete then
```