Do you tell people that "an elephant is like a tree", much?
I think you are talking about WinForms there. There's a lot more to .Net than targeting the "30 years of Windows C/C++ code" that makes up WinForms.
There's WPF on the desktop, and WPF's little brother, silverlight. The's serving web pages via ASP.Net WebForms and MVC variants, And serving data over web services. One could spend several careers using .Net without using as a wrapper for Windows' C Dlls.
(with apologies to Zandorg and Douglas Adams)
Is it' Java all the way down? No. All virtual machines and runtimes are wrappers over the OS's abilities. How is Java different here?
You know it's not more a compliment to .NET than a harsh critique on the (utterly detestable) Win32 API.
> Whereas Java has underlying it more Java, .NET has underlying it 30 years of carefully-optimised Windows C/C++ code
Your faith in humanity impresses me.
So I've seen this optimisation with my own eyes.
I also believe the Java stack has some very carefully optimized code too. It certainly has the performance to back up that affirmation. Besides that, it was designed to be easily portable to other OSs and architectures, a feature that's more important, IMHO, than speed under Windows.
Finally, you should only optimize for speed the code your profiler says has big impact on your performance. The rest you should optimize for readability and correctness. There is a lot of very subtle bugs we introduce when trying to optimize stuff and it's much easier to optimize correct code than to fix blazingly fast, heavily optimized buggy code.
Here's the main distinction: Whereas Java has underlying it more Java, .NET has underlying it 30 years of carefully-optimised Windows C/C++ code. It's basically a layer turning Java-like code into very fast Windows code.
And it's clear to me that Microsoft spent a lot of money writing this layer over Windows that makes writing Windows programs so easy. People don't give them credit for that.