I'm finishing my summer job where I write graphical software for our baggage scanners. Everything is done in .NET or MFC, with plain C++ for hardware communication (I don't do any of the hardware stuff). I sometimes resorted to Win32 API calls such as SendMessage to improve performance of a form or control. I've had only a year's worth of CS courses (all in C), but I am fascinated by the Win32 API--it is much larger and more powerful than I thought.
Does .NET simply hide all of the "tedious" or ground level work of the Win32 API? Does the final software consume more system resources or perform slower in .NET?
WinAPI (also known as Win32; officially called the Microsoft Windows API) is an application programming interface written in C by Microsoft to allow access to Windows features. The main components of the WinAPI are: WinBase: The kernel functions, CreateFile, CreateProcess, etc.
Alternatively referred to as the Windows API and WinAPI, Win32 is the main set of Microsoft Windows APIs used for developing 32-bit applications. These APIs are responsible for functions in the following categories: Administration and Management - Install, configure, and service applications or systems.
Win32 API support is obsolete and is supported only for backwards compatibility.
Windows exposes lots of functionality in the form of Win32 API. Using these API you can perform direct operation in windows, which increases performance of your application.
.Net generally makes development eaiser. It does this by providing a system which makes the common activities take less effort from the developer.
I love working in .NET. Before it became available, I worked primarily on a GUI written in C++ using MFC and Win32. When I switched to .NET, I had to totally revise my estimates because I could get stuff done faster!
To answer your actual questions: There are less-common development scenarios where .NET does not help (and some might say it gets in the way). Those generally involve low-level use of hardware communication or finely-tuned COM programming.
Note that you can do develop in C++ for .NET, allowing you to cross between Win32 and .NET with little to no effort. (It isn't standard C++ when you develop to the CLR, but it isn't tough to pick up the differences, either.)
Don't consider performance without an actual scenario that you can actually test. For an interesting performance comparison of .NET and C++ on the same task, check out the blog entry (and links!) here: http://blogs.msdn.com/b/ricom/archive/2005/05/10/416151.aspx
Does .NET simply hide all of the "tedious" or ground level work of the Win32 API? Does the final software consume more system resources or perform slower in .NET?
Yes, it tries to hide all the tedious details. And yes, a .NET application will generally be slower and is likely to consume more resources than a similar application written in C and Win32.
But the sacrifice in performance is usually a negligible price to pay for the gains in productivity and ease of maintainability.
I understand that the l33t-ness factor of programming so close to the bare metal using simple C and pure win32 might look very tempting, but I find it hard to justify when it would be many times easier and faster to use .NET.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With