added when-not-to-use-blank-lines
This commit is contained in:
parent
4fbfc28c9e
commit
6915945e92
1 changed files with 53 additions and 0 deletions
|
|
@ -0,0 +1,53 @@
|
|||
---
|
||||
title: "When not to use Blank Lines"
|
||||
tags: ["AL","Readability"]
|
||||
categories: ["Best Practice"]
|
||||
---
|
||||
|
||||
Do not use blank lines:
|
||||
|
||||
- at the beginning or end of any functions (after `begin` and before `end`)
|
||||
- inside multiline expressions
|
||||
|
||||
## #1 Example
|
||||
|
||||
### Bad code
|
||||
|
||||
```al
|
||||
procedure MATRIX_OnDrillDown(MATRIX_ColumnOrdinal: Integer);
|
||||
begin
|
||||
|
||||
SetupDrillDownCol(MATRIX_ColumnOrdinal);
|
||||
DrillDown(false, ValueType);
|
||||
|
||||
end;
|
||||
```
|
||||
|
||||
### Good code
|
||||
|
||||
```al
|
||||
procedure MATRIX_OnDrillDown(MATRIX_ColumnOrdinal: Integer);
|
||||
begin
|
||||
SetupDrillDownCol(MATRIX_ColumnOrdinal);
|
||||
DrillDown(false, ValueType);
|
||||
end;
|
||||
```
|
||||
|
||||
## #2 Example
|
||||
|
||||
### Bad code
|
||||
|
||||
```al
|
||||
if NameIsValid and
|
||||
|
||||
Name2IsValid
|
||||
then
|
||||
```
|
||||
|
||||
### Good code
|
||||
|
||||
```al
|
||||
if NameIsValid and
|
||||
Name2IsValid
|
||||
then
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue