alguidelines/content/docs/BestPractices/blank-lines-when-not-to-use/index.md
2022-03-19 23:04:56 +01:00

752 B

title tags categories
When not to use Blank Lines
AL
Readability
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

procedure MATRIX_OnDrillDown(MATRIX_ColumnOrdinal: Integer);
begin

    SetupDrillDownCol(MATRIX_ColumnOrdinal);
    DrillDown(false, ValueType);

end;

Good code

procedure MATRIX_OnDrillDown(MATRIX_ColumnOrdinal: Integer);
begin
    SetupDrillDownCol(MATRIX_ColumnOrdinal);
    DrillDown(false, ValueType);
end;

#2 Example

Bad code

if NameIsValid and

    Name2IsValid
then

Good code

if NameIsValid and
    Name2IsValid
then