web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Why are there plenty of spaces in X++?

(0) ShareShare
ReportReport
Posted on by

spaces.png

Just curious why there are so many spaces.


I can see SalesTable spaces is for formatting purposes to align with the line below. 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Smartus Profile Picture
    620 on at

    Hi Djim,

    It is a best practice to put parameters on a seperate line.

    I don't really know if it's a best practice, but what I usually see is that people tend to put the type on the same indentation level and the parameter name also under eachother on the same indentation level.

    Same is taken in account for variables inside your method.

    On your screenshot, it looks kind a weird though.

    The method could look like this:

    14027.Untitled.png

    As you can see the types of the parameters are on the same indentation level and the names as well.

    Here are some of the layout standards:

    https://msdn.microsoft.com/en-us/library/aa619943.aspx

    And here are some of the best practices in x++ coding:

    https://msdn.microsoft.com/en-us/library/cc967435.aspx#Format

    Hope that helps.

    Kind regards,

    Vincent Verweij

  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,158 Super User 2025 Season 2 on at

    Hi Djim,

    Vincent is correct about using spacing to have an overview and some structure. Your example is related to a customization, but not aligned correctly. It does say something about the developer...  The example provided by Vincent is according the best practices.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans