Is .NET better than Win32 or the othe way around? Which would be the pros \ cons of both, in what situations one would be better than the other. Has Microsoft released .Net as a replacement for Win32?
I am not asking about the amount of projects needed to be maintained, but about new projects being developed, and which would be better for what. Do you think .Net lacks important stuff from win32 (without using dllImport )? And do you think Win32 will be replaced by .Net
I am asking this, because i am having an argument with a friend of mine, and as we both agree both must be studied in depth My friend argues that .Net is incomplete, and i say that it can manage almost any task non-driver related. Where does .Net fail?
Obsolete? Not likely. There will always be a need for people who understand how Windows works at a lower level.
1.Win32 is also known as the Windows API while the MFC is a C++ class library that wraps parts of the Windows API. 2.The MFC consists of the most common operations used in building a Win32 application. 3.Using the MFC makes the coding lighter and a lot simpler than using the Windows API directly.
No. Win32 is used by so many applications (including those that ship with Windows), that it's going to be there for a long long time.
These are all from my POV. Your mileage may vary.
Advantages of .NET:
Disadvantages of .NET:
Advantages of WIN32:
Disadvantages of WIN32:
Both have their place, and will probably continue to exist until a true replacement OS (Midori? Some form of web-based OS?) comes online and gains widespread acceptance.
.Net (or the WinForms parts, anyway) sits on top of Win32. Or, put another way, Win32 was used to build .Net forms components. So in that sense you can think of .Net as a set of pre-built win32 widgets. You can also think of .Net as the logical successor to MFC.
.Net also has the ability to call into the Win32 API directly when necessary, gives you garbage collection, a very nice class library in the BCL, and a lot of nice language features over C/C++ in C# and VB.Net.
What you lose to get all these things is a certain amount of independence. .Net is an add-on framework that is not shipped with all versions of windows by default, and therefore you have extra dependencies to worry about at deployment. You also have performance considerations to think about when using any high-level garbage collected language, where seemingly simple code might be doing a lot more than you expect behind the scenes. This is especially true for some of the winforms components.
You already seem to be aware of the short answer, but I'll reiterate it here for clarity:
Win32: Powerful and complete. Any documented behavior on the windows platform can be composed via Win32, but with power comes responsibility and difficulty. There's a pretty significant amount of subtlety and difficulty in creating rich Win32 experiences.
.Net: Powerful, but a subset of Win32. .Net provides more than enough capability for the vast majority of line-of-business apps and more, but rich UI and specific, specialized situations simply don't exist within it because the BCL, for whatever reason, doesn't believe it makes sense to support it. The most common example that I've run across is UI capabilities in newer versions of Windows, though there are other areas where PInvoke is useful. .Net is a much simpler model to grasp and work within, however, and (in my experience) the subtlety of .net is much less likely to shoot me in the foot than Win32 is.
If you include dllimport and PInvoke, then I'd guess that .Net is a reasonable alternative that's capable of performing suitably well in 90+% of tasks, and WPF brings a whole different level of rich UI to the managed world.
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