alguidelines.dev - Business Central Design Patterns alguidelines.dev
  • Docs
  • Discussions
  • GitHub
  • Discord
  • Docs
    • Design Patterns
      • API Register Fieldset
      • Command Queue
      • Delegate API Operation
      • Event Bridge
      • Façade
      • Generic Method
      • No. Series
      • Template Method Pattern
    • Best Practices
      • API Page / Query
      • begin as an afterword
      • Begin-End - Compound Only
      • Binary Operator to Start Line
      • CASE Action on next line
      • Comment Spacing
      • Custom Telemetry
      • DeleteAll
      • end else pair
      • if not then exit
      • IsTemporary record safeguard
      • Keyboard Shortcuts
      • Keyword Pairs - Indentation
      • Line Start Keywords
      • Lonely Repeat
      • Named Invocations
      • One Statement per Line
      • Seperate if and else
      • Spacing Binary Operators
      • Subscriber Codeunits
      • Suggested Abbreviations
      • Unnecessary else
      • Unnecessary true/false
      • Variable Naming
      • Variables Declarations Order
      • When not to use Blank Lines
    • NAV Patterns Archive
      • 1. Patterns
        • Activity Logs
        • Argument Table
        • Blocked Entity
          • Data Driven Blocked Entity
        • Cached Web Server Calls
        • Conditional Cascading Update
        • Copy Document
        • Create Data from Templates
        • Create URLs to NAV Clients
        • Creating Custom Charts
        • Cross Session Events
        • Currently Active Record
        • Data Migration Façade
        • Discovery Event
        • Document
        • Easy Update Of Setup Or Supplementary Information
        • Error Message Processing
        • Extending the Role Center Headlines
        • Feature Localization For Data Structures
        • Hooks
        • Surrogate keys using Autoincrement Pattern
        • Instructions in the UI
        • Integration of Addresses
        • Journal Error Processing
        • Journal Template Batch Line
        • Master Data
        • Multi-file Download
        • Multi-Page List
        • Multilanguage Application Data
        • NET Exception Handling in CAL
          • TryFunction NET Exception Handling in CAL
        • No Series
        • Notifications
          • In-context Notifications
          • Notification Lifecycle Management Pattern
        • Observer
        • Posting Routine - Select Behavior
        • Product Name
        • Queries
          • SELECT DISTINCT with Queries
          • Use Queries to Detect Duplicate Records
          • Use Queries to Replace Nested Loops
        • Read-once Initialization and Validation
        • Released Entity
        • Report Selection
        • Security
          • Sensitive Data Encapsulation
          • Data Encryption
          • Single Point of Access
          • Masked Text
          • SSL in NAV
        • Setup Specificity Fallback
        • Silent File Upload and Download
        • Singleton
          • Singleton Codeunit
          • Singleton Table
            • Cue Table
            • Setup Table
        • Standard Journal
        • Temporary Dataset Report
        • Totals and Discounts on Subpages Sales and Purchases
        • Transfer Custom Fields
        • Variant Facade
      • 2. Anti-Patterns
        • Nav Upgrade
        • Reusable Bugs
      • 3. CAL Coding Guidelines
        • Design
          • By Reference Parameters
          • Class Coupling
          • Cyclomatic Complexity
          • Encapsulate Local Functionality
          • FINDSET FINDFIRST FINDLAST
          • Initialized Variables
          • Maintainability Index
          • Parameter Placeholders
          • Static Object Invocation
          • Unreachable Code
          • Unused Initialized Variables
          • Unused Variables
          • Variable Capacity Mismatch
          • WITH Scope Name Collision
        • Internally used DotNet Types
        • Internationalization
          • Using Calcdate
        • Localizability
          • CaptionML on System Pages
          • FIELDCAPTION and TABLECAPTION
          • Global Text Constants
          • Use Text Constants
          • Using OptionCaptionML
        • Readability
          • Begin as an 'After Word'
          • Begin-End - Compound Only
          • Binary Operator to Start Line
          • Blank Lines
          • CASE Action
          • Colon usage in CASE
          • Comments inside Curly Brackets
          • Comment Spacing
          • END ELSE Pair
          • Indentation
          • Keyword Pairs - Indentation
          • Line Start Keywords
          • Lonely Repeat
          • Named Invocations
          • Nested WITHs
          • One Statement Per Line
          • Separate IF and ELSE
          • Spacing Binary Operators
          • Spacing Brackets and ::
          • Spacing Unary Operators
          • Suggested Abbreviations
          • Temporary Variable Naming
          • TextConst Suffixes
          • Unary Operator Line End
          • Unnecessary Compound Parenthesis
          • Unnecessary ELSE
          • Unnecessary Function Parenthesis
          • Unnecessary Separators
          • Unnecessary TRUE/FALSE
          • Variable Already Scoped
          • Variable Naming
          • Variables Declarations Order
        • UX
          • Actions - Images
          • CONFIRM
          • FIELDERROR
          • MESSAGE and ERROR
      • (OLD) Get Involved
        • Code of Conduct
        • Patterns Authors
        • Template for writing Nav Design Patterns
      • Related Links
    • Contributing
      • Formatting tips
      • Guide to Fork & PR
      • Understanding the Approval Process
      • Install Hugo
        • Devcontainer with VS Code
        • Manually on Windows 11
        • Powershell on Windows 11
      • Templates
        • Title Here
        • Title Here
View page source Edit this page Create child page Create Issue Discussions Create project issue
Tag Cloud
  • AL36
  • API3
  • C/AL136
  • Decoupling2
  • Extendability3
  • Interface2
  • Performance2
  • Productivity1
  • Readability55
  • Telemetry1
  • Testability2
Categories
  • Best Practice90
  • Pattern73
  1. Docs
  2. NAV Patterns Archive
  3. 3. CAL Coding Guidelines
  4. Readability

Readability

Tags:
  • C/AL
  • Readability
Categories:
  • Best Practice

C/AL Coding Guidelines

Readability

Generally, all readability rules are Microsoft style choices only. You can use them to keep consistency with the existing code.

Find the C/AL guidelines by expanding the menu in the left.


Begin as an 'After Word'

Begin-End - Compound Only

Binary Operator to Start Line

Blank Lines

CASE Action

Colon usage in CASE

Comments inside Curly Brackets

Comment Spacing

END ELSE Pair

Indentation

Keyword Pairs - Indentation

Line Start Keywords

Lonely Repeat

Named Invocations

Nested WITHs

One Statement Per Line

Separate IF and ELSE

Spacing Binary Operators

Spacing Brackets and ::

Spacing Unary Operators

Suggested Abbreviations

Temporary Variable Naming

TextConst Suffixes

Unary Operator Line End

Unnecessary Compound Parenthesis

Unnecessary ELSE

Unnecessary Function Parenthesis

Unnecessary Separators

Unnecessary TRUE/FALSE

Variable Already Scoped

Variable Naming

Variables Declarations Order

Last modified February 24, 2022: Added tags & categories + cleanup (5ee04366) by waldo1001
© 2022 alguidelines.dev Project All Rights Reserved