alguidelines/content/docs/NAVPatterns/3-cal-coding-guidelines/readability/one-statement-per-line/index.md
2022-02-24 14:45:35 +01:00

419 B

+++ title = "One Statement Per Line" weight = 910 tags = ["C/AL","Readability"] categories = ["Best Practice"] +++ A line of code should not have more than one statement.

Bad code

IF OppEntry.FIND('-') THEN EXIT

Good code

IF OppEntry.FIND('-') THEN   
  EXIT  

Bad code

TotalCost += Cost; TotalAmt += Amt;

Good code

TotalCost += Cost; 
TotalAmt += Amt;