After a couple of high level introductory articles around Dynamics 365 and the opportunity it presents, I would like to get a little technical for this edition. Today I would like to talk about X++, the programming language and its new manifestation. For those who are new to Dynamics Technology, X++ is a proprietary language used to develop in Microsoft Dynamics AX, this was the language since the beginning of product and Microsoft has been maintaining it so far in more or less same form till AX 2012. It’s an Object Oriented Language with power of simplicity and structure, which was able to cater to the fast growing pace of AX so far. So far so good but then X++ as a Language had its own limitations but then we will not talk about it now because it’s Past!
Fast forward AX 7 & Dynamics 365 for Operations, X++ is still there but in its new Incarnation, the language has just got better with the new form Microsoft has given it, to tell the least about effort Microsoft has put into the language, they have re-written the whole compiler for the language. Let’s discussed this new form and how it will help us to move Dynamics 365 for operations towards enterprise class applicability,
1. Integration with Visual Studio
With Dynamics 365 for Operations, the exclusive IDE for solution is Visual studio, which makes X++ a part of VS language family. This also makes the language more powerful because of the background and power the platform provides to it. The language is managed now and compiles into IL code only (Previous versions were pseudo-code based). With the new managed capability comes great power of precompiled code which runs faster and more effectively
2. New Language Feature
The language has got new features like ability to declare variables anywhere in the code to make it easier to write and manage code, static fields and constructor for classes, ability to define constant and read only variables, support for Var type variables, ability to have finally block in try catch statement and ability to define extension methods to name a few. (Extension is another new with Dynamics 365 which gives ability to extend system without touching the core code, we will discuss that in detail in another article)
3. Dropped and discouraged feature
Morphx is dropped as ID, it has been replaced by Visual studio. Statements like Print, Pause, Window has been dropped, Macro is supported for backward compatibility but it’s discouraged to use it because of the impact over performance of compiler Instead Const is suggested. Down casting of object is discouraged. Over layering is another aspect which is highly discouraged.
4. New Debugger Feature
With new IDE of Visual studio, comes the great power of Visual studio debugger. Among the benefits new VS debugger gives few notable ones are ability to Identify un-selected fields and new break point feature like hit count, conditional break point (Useful while dealing with huge amount of data) and action specific break point
The above mentioned features are only a glimpse into what can be done with the newly found power of X++, there is a lot more then above. Besides other family languages like C# has clear interoperability with X++ which gives us freedom to extend the system in our language of choice.