What I really wanted to say is that, apart from some minor things, almost everything can be done using XML only.
Yes, but with 10x number of lines, of "unreadable" code.
And if you look at XML code, it isn't more "bulky" than C++, except of course the variable names:
Code:
if (number == 1) { anothernumber = 2 }
Code:
(L:number,number) 1 == if{ 2 (>L:anothernumber,number) }
Yes, but writing a whole program, it's not just expressions. In fact, if we should be precise, you are not comparing the C++ language with the XML "language" (quotes on XML being a language, are intentional...), you are only comparing their expression evaluators, which are just a very small aspect of any language.
The only comparison you made here, is between a post-fix and in-fix notation...both have their merits, but a whole programming language is way more than that.
For myself, I just don't see any advantages in using C++. XML feels more "direct", no need to trigger any events to activate your systems, because everything can be done in the code section of your animated part.
We are talking about very simple things here, which is appropriate in a forum. But, what about if that "something" that needs to be happening when you click the mouse, is too complex to do in XML ?
You'll end up with an hybrid project, with lots of complex code in the XML section, and lots of complex code in C++ as well, which is a recipe for disaster, especially for maintenance, becase you are breaking one of the fundamental programming rules, which is "keep all the complexity as close as possible". If you figure it out you are going to use C++ anyway, it would be better to simply stick to it, and write as much as possible in C++, which will keep you the XML code simple in return.
Of course, we shouldn't forget performances. You can't even PROFILE XML which means, if your gauge is slow, you can't even check where, and why. When I use a code profiler, I know exactly how many micro-seconds each line of my code takes, and I have a report of which routines my program is spending most of its time.
An interesting story about this, that I mentioned at the MS Devcon in Seattle in 2007, is that, when profiling the F/A-18 Gauges, to squeeze the last possible bit of speed (the gauges are GDI+, which means you *have* to optimize), I found that, the most costly function, of ALL, was to simply CLEAR THE SCREEN, using the standard GDI+ call. It took more time to clear the screen, than to draw the whole gauge, even in case of the most complex one, which is the HSI with moving map+navaids. Yet, clearing the screen was quite costly, but of course you wouldn't suspect that, unless you run through a profiler. I was considering to play hardball, and replace the GDI+ clear screen function, with a custom one written in x86 ASM, perhaps even using SSE2 instructions to "kill" bits 128 bits at time, at a blazing speed. But it was maybe overkill, and luckily I found out that, if I cleared the screen using the regular GDI command insead of the GDI+ one, it would have worked the same, just 4-5 times faster and, since this was happening at every frame, on 4 gauges at the same time (3 MFD's + 1 HUD), and this was the most costly action of the whole gauge, the frame rate improvement was very noticeable!
No way you can do this with XML.
Let's not even start discussion how bad is to *debug* XML code. The VC++ debugger is so powerful, and work so well, that I wouldn't dream to do anything without it, except for the really trivial things.
When you are going into the more complex things, you'll find that XML simply can't cut it. Some things will not just be possible, but others might be so cumbersome and difficult to maintain, that your project might just fail because of that, or you simply find yourself writing and re-writing thousand of lines of code for EACH project, because the only "code reusability" that XML offers to you, other than the puny macro commands, it's copy&paste...
C++ superiority doesn't even show up in a single project, because this might be small enough that would have been doable in XML anyway. But should be evaluated over the course of several projects, that lies its main strenght.
Of course, this means using C++ to its fullest, very different from what you might have seen in SDK samples, and most of the fightsim-oriented tutorials, which are basically C, with almost no notion of OOP whatsoever.
Concept like using Class hierarchies, inheritance, methods, virtual functions, accessors and Templates, of all. And this is the low level.
At an higher level of abstraction, you'll use Patterns, which are not strictly related to C++, but can be applied to any OOP language (like C#, Java, Python, etc.), that are common ways to solve usual programming problems.
Read an older post of mine, that would give you more insight about what I mean:
http://www.newsite.fsdeveloper.com/forum/showpost.php?p=119515&postcount=5
None of this, of course, it's possible with XML, which is not really a language in the first place, but it's more an expression evaluator.