alguidelines/navpatterns/3-cal-coding-guidelines/readability/index.xml
2021-11-04 21:35:51 +00:00

140 lines
No EOL
23 KiB
XML

<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Readability on BC AL Help</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/</link><description>Recent content in Readability on BC AL Help</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><atom:link href="https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/index.xml" rel="self" type="application/rss+xml"/><item><title>Begin as an 'After Word'</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/begin-as-an-afterword/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/begin-as-an-afterword/</guid><description>When BEGIN follows THEN, ELSE, DO, it should be on the same line, preceded by one space character. Bad code
IF ICPartnerRefType = ICPartnerRefType::&amp;quot;Common Item No.&amp;quot; THEN BEGIN ... END; Good code
IF ICPartnerRefType = ICPartnerRefType::&amp;quot;Common Item No.&amp;quot; THEN BEGIN ... END;</description></item><item><title>Begin-End - Compound Only</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/begin-end/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/begin-end/</guid><description>Only use BEGIN..END to enclose compound statements. Bad code
IF FINDSET THEN BEGIN REPEAT ... UNTIL NEXT = 0; END; Good code
IF FINDSET THEN REPEAT ... UNTIL NEXT = 0; Bad code
IF IsAssemblyOutputLine THEN BEGIN TESTFIELD(&amp;quot;Order Line No.&amp;quot;,0); END; Good code
IF IsAssemblyOutputLine THEN TESTFIELD(&amp;quot;Order Line No.&amp;quot;,0); Bad code
IF FINDSET THEN REPEAT BEGIN ... END; UNTIL NEXT = 0; Good code
IF FINDSET THEN REPEAT .</description></item><item><title>Binary Operator to Start Line</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/binary-operator-line-start/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/binary-operator-line-start/</guid><description>Do not start a line with a binary operator. Bad code
&amp;quot;Quantity to Ship&amp;quot; := Quantity - &amp;quot;Quantity Shipped&amp;quot; Good code
&amp;quot;Quantity to Ship&amp;quot; := Quantity - &amp;quot;Quantity Shipped&amp;quot;</description></item><item><title>Blank Lines.md</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/blank-lines/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/blank-lines/</guid><description>Do not use blank lines at the beginning or end of any functions, after BEGIN, before END, or inside multiline expressions. Bad code
PROCEDURE MATRIX\_OnDrillDown@1133(MATRIX\_ColumnOrdinal : Integer); BEGIN SetupDrillDownCol(MATRIX\_ColumnOrdinal); DrillDown(FALSE,ValueType); END; Good code
PROCEDURE MATRIX\_OnDrillDown@1133(MATRIX\_ColumnOrdinal : Integer); BEGIN SetupDrillDownCol(MATRIX\_ColumnOrdinal); DrillDown(FALSE,ValueType); END; Bad code
IF NameIsValid AND Name2IsValid THEN Good code
IF NameIsValid AND Name2IsValid THEN</description></item><item><title>CASE Action</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/case-actions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/case-actions/</guid><description>A CASE action should start on a line after the possibility. Bad code
CASE Letter OF 'A': Letter2 := '10'; 'B': Letter2 := '11'; Good code
CASE Letter OF 'A': Letter2 := '10'; 'B': Letter2 := '11';</description></item><item><title>Colon usage in CASE</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/colon-usage-in-case/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/colon-usage-in-case/</guid><description>The last possibility on a CASE statement must be immediately followed by a colon. Bad code
CASE DimOption OF DimOption::&amp;quot;Global Dimension 1&amp;quot; : DimValue.&amp;quot;Dimension Code&amp;quot; := GLSetup.&amp;quot;Global Dimension 1 Code&amp;quot;; Good code
CASE DimOption OF DimOption::&amp;quot;Global Dimension 1&amp;quot;: DimValue.&amp;quot;Dimension Code&amp;quot; := GLSetup.&amp;quot;Global Dimension 1 Code&amp;quot;;</description></item><item><title>Comments inside Curly Brackets</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/comments-curly-brackets/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/comments-curly-brackets/</guid><description>Never use curly bracket comments. During development, the &amp;ldquo;Block comment&amp;rdquo; functionality can be used instead. However, in production code, block comments are not recommended. Bad code
PeriodTxt: {Period} Good code
PeriodTxt: // Period Bad code
PROCEDURE MATRIX\_OnAfterGetRecord@10(MATRIX\_ColumnOrdinal : Integer); BEGIN { IF ShowColumnName THEN MatrixHeader := MatrixRecords\[MATRIX\_ColumnOrdinal\].Name ELSE MatrixHeader := MatrixRecords\[MATRIX\_ColumnOrdinal\].Code; } MatrixRecord := MatrixRecords\[MATRIX\_ColumnOrdinal\]; AnalysisValue := CalcAmt(ValueType,TRUE); MATRIX\_CellData\[MATRIX\_ColumnOrdinal\] := AnalysisValue; END; Good code
PROCEDURE MATRIX\_OnAfterGetRecord@10(MATRIX\_ColumnOrdinal : Integer); BEGIN MatrixRecord := MatrixRecords\[MATRIX\_ColumnOrdinal\]; AnalysisValue := CalcAmt(ValueType,TRUE); MATRIX\_CellData\[MATRIX\_ColumnOrdinal\] := AnalysisValue; END;</description></item><item><title>Comment Spacing</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/comments-spacing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/comments-spacing/</guid><description>Always start comments with // followed by one space character. Bad code
RowNo += 1000; //Move way below the budget Good code
RowNo += 1000; // Move way below the budget</description></item><item><title>END ELSE Pair</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/end-else-pair/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/end-else-pair/</guid><description>The END ELSE pair should always appear on the same line. Bad code
IF OppEntry.FIND('-') THEN IF SalesCycleStage.FIND('-') THEN BEGIN ... END ELSE ... Good code
IF OppEntry.FIND('-') THEN IF SalesCycleStage.FIND('-') THEN BEGIN ... END ELSE ...</description></item><item><title>Indentation</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/indentation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/indentation/</guid><description>In general, use an indentation of two space characters. Logical expressions in the IF, WHILE, and UNTIL parts are indented at least 3, 6, and 6 spaces respectively. Bad code
IF GLSetup.&amp;quot;Unrealized VAT&amp;quot; OR (GLSetup.&amp;quot;Prepayment Unrealized VAT&amp;quot; AND NewCVLedgEntryBuf.Prepayment) Good code
IF GLSetup.&amp;quot;Unrealized VAT&amp;quot; OR (GLSetup.&amp;quot;Prepayment Unrealized VAT&amp;quot; AND NewCVLedgEntryBuf.Prepayment) Bad code
IF GenJnlLine.&amp;quot;Account No.&amp;quot; &amp;lt;\&amp;gt; ICPartner.Code THEN ICPartner.GET(&amp;quot;Account No.&amp;quot;); IF GenJnlLine.Amount \&amp;gt; 0 THEN BEGIN ... Good code</description></item><item><title>Keyword Pairs - Indentation</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/keyword-pairs-indentation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/keyword-pairs-indentation/</guid><description>The IF..THEN pair, WHILE..DO pair, and FOR..DO pair must appear on the same line or the same level of indentation. Bad code
IF (x = y) AND (a = b) THEN Good code
IF (x = y) AND (a = b) THEN</description></item><item><title>Line Start Keywords</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/line-start-keywords/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/line-start-keywords/</guid><description>The END, IF, REPEAT, FOR, WHILE, ELSE and CASE statement should always start a line. Bad code
IF IsContactName THEN ValidateContactName ELSE IF IsSalespersonCode THEN ValidateSalespersonCode ELSE IF IsSalesCycleCode THEN ValidatSalesCycleCode; Good code
IF IsContactName THEN ValidateContactName ELSE IF IsSalespersonCode THEN ValidateSalespersonCode ELSE IF IsSalesCycleCode THEN ValidatSalesCycleCode;</description></item><item><title>Lonely Repeat</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/lonely-repeat/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/lonely-repeat/</guid><description>The REPEAT statement should always be alone on a line. Bad code
IF ReservEntry.FINDSET THEN REPEAT Good code
IF ReservEntry.FINDSET THEN REPEAT</description></item><item><title>Named Invocations</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/named-invocations/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/named-invocations/</guid><description>When calling an object statically use the name, not the number Bad code
PAGE.RUNMODAL(525,SalesShptLine) Good code
PAGE.RUNMODAL(PAGE::&amp;quot;Posted Sales Shipment Lines&amp;quot;,SalesShptLine)</description></item><item><title>Nested WITHs</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/nested-withs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/nested-withs/</guid><description>Do not nest WITHs that reference different types of objects. Bad code
WITH PostedWhseShptLine DO BEGIN ... WITH ItemLedgEntry DO InsertBufferRec(...,&amp;quot;Serial No.&amp;quot;,&amp;quot;Lot No.&amp;quot;,...); ... END; Good code
WITH PostedWhseShptLine DO BEGIN ... InsertBufferRec(...,ItemLedgEntry.&amp;quot;Serial No.&amp;quot;,ItemLedgEntry.&amp;quot;Lot No.&amp;quot;,...); ... END;</description></item><item><title>One Statement Per Line</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/one-statement-per-line/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/one-statement-per-line/</guid><description>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;</description></item><item><title>Separate IF and ELSE</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/separate-if-and-else/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/separate-if-and-else/</guid><description>IF and ELSE statements should be on separate lines. Bad code
IF Atom\[i+1\] = '\&amp;gt;' THEN HasLogicalOperator := TRUE ELSE BEGIN ... END; Good code
IF Atom\[i+1\] = '\&amp;gt;' THEN HasLogicalOperator := TRUE ELSE BEGIN ... END;</description></item><item><title>Spacing Binary Operators</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/spacing-binary-operators/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/spacing-binary-operators/</guid><description>There must be exactly one space character on each side of a binary operator such as = + - AND OR =. The parameter comma operator however, should have no spaces. Bad code
&amp;quot;Line Discount %&amp;quot; := &amp;quot;Line Discount Amount&amp;quot;/&amp;quot;Line Value&amp;quot;\*100 Good code
&amp;quot;Line Discount %&amp;quot; := &amp;quot;Line Discount Amount&amp;quot; / &amp;quot;Line Value&amp;quot; \* 100; Bad code
StartDate := CALCDATE('&amp;lt;+'+FORMAT(Days + i)+'D\&amp;gt;', StartDate); Good code
StartDate := CALCDATE('&amp;lt;+' + FORMAT(Days + i) + 'D\&amp;gt;',StartDate); Bad code</description></item><item><title>Spacing Brackets and ::</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/spacing-brackets-and/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/spacing-brackets-and/</guid><description>There must be no spaces characters before and after [] dimension brackets symbols or :: option symbols. Bad code
A\[i\] \[j\] := Amt; Good code
A\[i\]\[j\] := Amt; Bad code
&amp;quot;Currency Exchange Rate&amp;quot;.&amp;quot;Fix Exchange Rate Amount&amp;quot; :: Currency: Good code
&amp;quot;Currency Exchange Rate&amp;quot;.&amp;quot;Fix Exchange Rate Amount&amp;quot;::Currency: Bad code
IF FIND (Which) THEN Good code
IF FIND(Which) THEN</description></item><item><title>Spacing Unary Operators</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/spacing-unary-operators/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/spacing-unary-operators/</guid><description>There must be no space between a unary operator and its argument (except for the NOT keyword). Bad code
IF NOT(Type = Type::Item) THEN Good code
IF NOT (Type = Type::Item) THEN Bad code
DiscAmt := - &amp;quot;Discount Amount&amp;quot;; Good code
DiscAmt := -&amp;quot;Discount Amount&amp;quot;;</description></item><item><title>Suggested Abbreviations</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/suggested-abbreviations/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/suggested-abbreviations/</guid><description>Suggested Abbreviations Whenever possible, do not use abbreviations in variables, functions and objects names.
If there is no other choice, then use the suggestions below.
Abbreviation
Text
Abs
absence
Acc
account
Acc
accounting
Accum
accumulated
Act
action
Activ
activity
Add
additional
Addr
address
Adj
adjust
Adjd
adjusted
Adjmt
adjustment
Agrmt
agreement
Alloc
allocation
Allow
allowance
Alt
alternative
Amt
amount
Amts
amounts
Ans
answer
Appl
applies
Appln
application
Arriv
arrival
Asm</description></item><item><title>Temporary Variable Naming</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/temporary-variable-naming/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/temporary-variable-naming/</guid><description>The name of a temporary variable must be prefixed with the word Temp and not otherwise. Bad code
JobWIPBuffer@1002 : TEMPORARY Record 1018; Good code
TempJobWIPBuffer@1002 : TEMPORARY Record 1018; Bad code
TempJobWIPBuffer@1002 : Record 1018; Good code
CopyOfJobWIPBuffer@1002 : Record 1018;</description></item><item><title>TextConst Suffixes</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/textconst-suffixes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/textconst-suffixes/</guid><description>TextConst variable names should have a suffix (an approved three-letter suffix: Msg, Tok, Err, Qst, Lbl, Txt) describing usage. Bad code
CannotDeleteLine@1005 : TextConst 'ENU=You cannot delete this line because one or more rating values exists.'; ... ERROR(CannotDeleteLine,TABLECAPTION); Good code
CannotDeleteLineErr@1005 : TextConst 'ENU=You cannot delete this line because one or more rating values exists.'; ... ERROR(CannotDeleteLineErr,TABLECAPTION); Bad code
Text000@1011 : TextConst 'ENU=&amp;quot;has been changed (initial a %1: %2= %3, %4= %5)&amp;quot;'; .</description></item><item><title>Unary Operator Line End</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/unary-operator-line-end/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/unary-operator-line-end/</guid><description>Do not end a line with unary operator. Bad code
&amp;quot;Quantity Handled (Base)&amp;quot; := - &amp;quot;Quantity Handled (Base)&amp;quot;); Good code
&amp;quot;Quantity Handled (Base)&amp;quot; := - &amp;quot;Quantity Handled (Base)&amp;quot;);</description></item><item><title>Unnecessary Compound Parenthesis</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/unnecessary-compound-parenthesis/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/unnecessary-compound-parenthesis/</guid><description>Use parenthesis only to enclose compound expressions inside compound expressions. Bad code
IF (&amp;quot;Costing Method&amp;quot; = &amp;quot;Costing Method&amp;quot;::Standard) THEN Good code
IF &amp;quot;Costing Method&amp;quot; = &amp;quot;Costing Method&amp;quot;::Standard THEN Bad code
ProfitPct = -(Profit) / CostAmt \* 100; Good code
ProfitPct = -Profit / CostAmt \* 100;</description></item><item><title>Unnecessary ELSE</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/unnecessary-else/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/unnecessary-else/</guid><description>ELSE should not be used when the last action in the THEN part is an EXIT, BREAK, SKIP, QUIT, ERROR. Bad code
IF IsAdjmtBinCodeChanged THEN ERROR(AdjmtBinCodeChangeNotAllowedErr,...) ELSE ERROR(BinCodeChangeNotAllowedErr,...); Good code
IF IsAdjmtBinCodeChanged THEN ERROR(AdjmtBinCodeChangeNotAllowedErr,...) ERROR(BinCodeChangeNotAllowedErr,...);</description></item><item><title>Unnecessary Function Parenthesis</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/unnecessary-function-parenthesis/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/unnecessary-function-parenthesis/</guid><description>Do not use parenthesis in a function call if the function does not have any parameters. Bad code
IF ReservMgt.IsPositive() THEN Good code
IF ReservMgt.IsPositive THEN Bad code
IF ChangeStatusForm.RUNMODAL() &amp;lt;\&amp;gt; ACTION::Yes THEN Good code
IF ChangeStatusForm.RUNMODAL &amp;lt;\&amp;gt; ACTION::Yes THEN</description></item><item><title>Unnecessary Separators</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/unnecessary-separators/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/unnecessary-separators/</guid><description>There should be no unnecessary separators. Bad code
IF Customer.FINDFIRST THEN;; Good code
IF Customer.FINDFIRST THEN;</description></item><item><title>Unnecessary TRUE/FALSE</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/unnecessary-truefalse/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/unnecessary-truefalse/</guid><description>Do not use TRUE or FALSE keywords unnecessarily if the expression is already an logical expression. Bad code
IF IsPositive() = TRUE THEN Good code
IF IsPositive THEN Bad code
IF Complete &amp;lt;\&amp;gt; TRUE THEN Good code
IF NOT Complete THEN</description></item><item><title>Variable Already Scoped</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/variable-already-scoped/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/variable-already-scoped/</guid><description>Do not use scope &amp;lsquo;&amp;rsquo;.'' qualifier unnecessarily when a variable is already implicitly or explicitly scoped. It keeps the code simpler. Bad code
ReturnRcptHeader.SETRANGE(ReturnRcptHeader.&amp;quot;Return Order No.&amp;quot;,&amp;quot;Document No.&amp;quot;); Good code
ReturnRcptHeader.SETRANGE(&amp;quot;Return Order No.&amp;quot;,&amp;quot;Document No.&amp;quot;); Bad code
WITH ChangeLogSetupTable DO BEGIN ... IF ChangeLogSetupTable.DELETE THEN ... END; Good code
WITH ChangeLogSetupTable DO BEGIN ... IF DELETE THEN ... END;</description></item><item><title>Variable Naming</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/variable-naming/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/variable-naming/</guid><description>Variables that refer to a C/AL object must contain the objects name, abbreviated where necessary.
A variable must begin with a capital letter.
Blanks, periods, and other characters (such as parentheses) that would make quotation marks around a variable necessary must be omitted.
If a variable is a compound of two or more words or abbreviations, each word or abbreviation should begin with a capital letter. Bad code
... WIPBuffer@1002 : Record 1018 .</description></item><item><title>Variables Declarations Order</title><link>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/variables-declarations-order/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://microsoft.github.io/bcalhelp/navpatterns/3-cal-coding-guidelines/readability/variables-declarations-order/</guid><description>Variables declarations should be ordered by type. In general, object and complex variable types are listed first followed by simple variables. The order should be the same as the object list in the object designer for C/AL objects. Afterwards come the complex variables like RecordRef, .NET, FieldRef etc. At the end come all the simple data types in no particular order. Bad code
StartingDateFilter@1002 : Text\[30\]; Vend@1003 : Record 23; Good code</description></item></channel></rss>