I have been developing software, from web applications, to iPhone apps and Windows programs, for as long as I can remember. I have used HTML, ASP, C++, C#, PHP, Objective-C, and the list goes on. Recently I joined a Microsoft Dynamics AX development team, and that meant a brand new language I’d never seen before: X++. This is a taste of what I’ve learned and a quick comparison to other languages I’ve encountered in my career.

X++ vs. C++

Before becoming an X++ developer, my object-oriented language of choice was C++, so let’s compare them. Syntactically, the two languages are very similar. In fact, you could copy and paste portions of well-written code from either language into the other with little modification. For example, looping and conditional statements are identical.

One of the most interesting nuances is how variables are used in X++. In C++ you can generally declare a variable wherever you need it and use it within the same scope, although it is best practice to declare all of your variables globally or in the top of the function. In X++, that C++ best practice becomes law. Variables in X++ must be declared either in the class declaration (global to that object) or at the top of the method. In fact, the compiler requires you to place an extra semicolon after the variable declarations in most scenarios.

Another thing that separates X++ from C++ is how it is used. C++ can be used for many things, from entirely new applications, to Windows tools and even computer games. X++, on the other hand, is used in conjunction with Microsoft Dynamics AX’s MorphX IDE (Integrated Development Environment) to modify and customize Microsoft Dynamics AX.

Of course there are more similarities and differences between X++ and C++, but those are two of the biggest in my opinion. X++ also bears resemblance to other programming languages. In fact, you can write very SQL-like commands in your X++ code to handle data. For more information on SQL in X++ check out this article by my colleague.

Other Things I’ve Learned Using X++

Since X++ is used as part of Microsoft Dynamics, there is a lot more involved in developing in it than just coding. Microsoft Dynamics also has an AOT (Application Object Tree) full of objects – tables, classes, forms, etc. – that you can modify and interact with. Some things that would have had to be done in complicated code in other languages, such as changing something on a form or a table, can be done in the MorphX environment using drag-and-drop, property sheets, and other simple integrated operations. X++ is used to handle more complex things like business logic and conditional formatting. The combination of MorphX and X++ code simplifies the modification of Dynamics AX and allows developers to focus on the problem at hand instead of building things from the ground-up like other languages.


Microsoft Dynamics AX is a robust ERP and Lean manufacturing enabler. The latest release, Dynamics AX 2012, combines the powerful planning and execution features required of comprehensive ERP integrated with the features of Lean to assist the "blended" manufacturer. Contact Agility Business Solutions, Inc. to learn more.