5 ms·
I just started learning .NET and C#. My first impression is that it makes using all the Windows API really easy. So, you can get the time without fiddling with
by zandorg 16y ago
I just started learning .NET and C#. My first impression is that it makes using all the Windows API really easy. So, you can get the time without fiddling with C time structs, and use DLL's without allocating memory.
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.
- rbanffy 16y ago> So, you can get the time without fiddling with C time structs 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.
- zandorg 16y agoI once decompiled a Windows Microsoft DLL imported function, and it clearly had a lot of optimisations such as quitting if the 1st character is 'n', etc. So I've seen this optimisation with my own eyes.
- rbanffy 16y agoI believe some places have very tightly optimized code. What I question is the risky assumption that under every .NET class you have carefully optimized code, refined for over 30 years. What did I use 30 years ago? Oh... A 6502. I had an Apple II+. 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.
- zandorg 16y agoI admit I was way off - Windows has only been around since 1985 or so, and in usable form since 1990. And Java does have some very fast code. And I agree about optimisations too. It's easy to go overboard to get more speed.
- mkramlich 16y agoI was doing hand-optimizing of 6502 on the Apple ][+ back then. Well, a little bit, admittedly. The thing to do seemed to be a mix of BASIC and machine language. CALL-151 for the win!
- StrawberryFrog 16y ago.NET has underlying it 30 years of carefully-optimised Windows C/C++ code. it makes using all the Windows API really easy. 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.
- mkramlich 16y agoUnfortunately when he said "30 years of carefully-optimised Windows C/C++ code" what he did not know at the time was that the phrase leaked through a wormhole into an alternate dimension and was then overheard just as the commanders of two massive battle fleets were making a last minute effort at diplomacy to forestall what would otherwise surely be an imminent major galactic war. More unfortunately, the sound of describing the underpinnings of .NET as being "30 years of carefully-optimized Windows C/C++ code" is almost exactly not quite entirely unlike the sound produced in the Ferhfxian language of the insult, "Your mother is very nice. And tasty." and so, unfortunately, a great galactic war broke out, that lasted for thousands and thousands of years, until nothing but two dead lifeless planets were left, and it was all clearly the fault of Microsoft, once again. (with apologies to Zandorg and Douglas Adams)
- StrawberryFrog 16y agoWhereas Java has underlying it more Java, 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?