Jump to content
  • Advertisement
Sign in to follow this  
Chris27

.NET vs Windows API

This topic is 3766 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've read a few threads on this topic, but I haven't seen any difinitive answer on weather people believe that .NET is going to be used for game progamming in the future and the Windows API will become obsolete at some point. I've learned most of the basics of C++ and have started to learn to create windows using windows.h. I find the work very tedius. Pointers complicate things due to the many different applications of '*' and '&'. You can useually figure out whats going on, but the code can be really confusing. I don't believe C++ is fully object oriented. From my knowlede the Windows API was written in C which isn't object oriented. This makes for more code and added confusion when making an application. Having to deal with memory management is a hazzard. In C++ you have to worry about deleting your pointers if you use the heap so that you don't get memory leaks. This is just more overhead to worry about. You have to worry a lot about which API you are using because of incompatabilities in C++. There is a lot of additional code to worry about in terms of preprocessing directives. Then we have .NET. In general it's very easy to read and there is less chance of confusion. To get a Window up and running requires very little code as you can just inherit the form class and if you like use the Windows designer to create your controls. The libraries are easy to access and view via the object browser and the intellisense in visual studio is enhanced to make sure you don't make mistakes/help you to find the classes, methods, and properties you need. .NET will generally run on any Windows as long as you have .NET installed on the OS. .NET if fully object oriented programming which makes your code a bit more organized and safe from harm. .NET manages memory for you so for the most part you don't have to worry about memory leaks. For the most part it just seems better because it's a newer technology and does away with a lot of older and more tedius concepts. The only reasons I can think to program a game in C++ Windows API is because you can get a little better performance out of it if you really know what you are doing and because of directx which is unmanaged. Of course XNA game studio is coming along and may one day replace directx as .NET may one day replace the Windows API. [Edited by - Chris27 on June 26, 2008 12:43:29 PM]

Share this post


Link to post
Share on other sites
Advertisement
Well if you don't like Win32 don't use it. I personally like it quite a bit. You can't really compare .NET and the Win32 API, .NET is a huge framework, you could, I suppose compare Windows.Forms to the Win32 API, but even then, it is a stretch.

Share this post


Link to post
Share on other sites
Quote:
Original post by Chris27
I've read a few threads on this topic, but I haven't seen any difinitive answer on weather people believe that .NET is going to be used for game progamming in the future and the Windows API will become obsolete at some point.


Yes, it is and No it won't. .Net is a wrapper for Win32 so that people that need to develop applications rapidly can do so without all the issues you detailed.
For those who need the speed, are doing something like implementing a Win32 wrapper, or need to do something .Net can't do (yet), you still need Win32 and .Net isn't much help.
It's kind of like asking if HTML and javascript will cease to exist because Google Web Toolkit was released. It's another technology layer, not another technology.

Share this post


Link to post
Share on other sites
If you like Win32 thats OK I guess. I'm more curius to hear weather or not .NET and XNA will be used for game programming in the future. I can't imagine that games will continue to be programmed using C++ and Directx forever. Especially when there is an easier, faster, safter, and more organized tool availble to make them.

Share this post


Link to post
Share on other sites
Quote:
Original post by MaliciousDigit
Quote:
Original post by Chris27
I've read a few threads on this topic, but I haven't seen any difinitive answer on weather people believe that .NET is going to be used for game progamming in the future and the Windows API will become obsolete at some point.


Yes, it is and No it won't. .Net is a wrapper for Win32 so that people that need to develop applications rapidly can do so without all the issues you detailed.
For those who need the speed, are doing something like implementing a Win32 wrapper, or need to do something .Net can't do (yet), you still need Win32 and .Net isn't much help.
It's kind of like asking if HTML and javascript will cease to exist because Google Web Toolkit was released. It's another technology layer, not another technology.


Well that makes sense, but I still can't imagine that people will be writting games using a programming language that is so old, error prone, and difficult to read forever even if the Win32 API always exists underneath the .NET.

Share this post


Link to post
Share on other sites
Quote:
Original post by Chris27
I don't believe C++ is fully object oriented.


Yes, well we are all wrong some days.

.Net probably won't over take C++ for a while since two of the three consoles out there can't and won't run it(nor their future iterations). On the PC/Xbox front you are going to have to wait out all the current pros and then some. People tend to not like new even if it is better. I am sure we will see more small and indie devs moving to it for just the reasons you mention. For the larger devs who already have so much invested in C++ they will take 10+ years to go to a better language which may or may not be .net related since it will have to be something both Nintendo and Sony are willing to run on their boxes.

Share this post


Link to post
Share on other sites
Quote:
Original post by stonemetal
Quote:
Original post by Chris27
I don't believe C++ is fully object oriented.


Yes, well we are all wrong some days.

.Net probably won't over take C++ for a while since two of the three consoles out there can't and won't run it(nor their future iterations). On the PC/Xbox front you are going to have to wait out all the current pros and then some. People tend to not like new even if it is better. I am sure we will see more small and indie devs moving to it for just the reasons you mention. For the larger devs who already have so much invested in C++ they will take 10+ years to go to a better language which may or may not be .net related since it will have to be something both Nintendo and Sony are willing to run on their boxes.


That makes sense as well. So does that mean games will eventually be written using something like XNA? I don't see many people programming games using this technology so far. Not even the indy types. Also there is Interop in .NET that allows access to Win32 API if I'm not mistaken. You just have to wrap things and make sure all types are compatible between C# and C++.

Share this post


Link to post
Share on other sites
Quote:
Original post by Chris27
I don't believe C++ is fully object oriented. From my knowlede the Windows API was written in C which isn't object oriented. This makes for more code and added confusion when making an application.


C++ is a multi-paradigm language. Windows API is not a part of C++.

Quote:
Original post by Chris27
Having to deal with memory management is a hazzard. In C++ you have to worry about deleting your pointers if you use the heap so that you don't get memory leaks.


When writing idiomatic C++ you don't have to. You should use [link href=http://en.wikipedia.org/wiki/RAII]RAII[/link] for managing resources, e.g. boost::shared_ptr or std::tr1::shared_ptr, etc. It's a lot better than garbage collectors, because you know exactly when an object is being destroyed. In a properly written C++ program you'll find at most a few delete keywords if any.

Quote:
Original post by Chris27
You have to worry a lot about which API you are using because of incompatabilities in C++.

Which incompatibilities? You mean between different compilers?

Share this post


Link to post
Share on other sites
Quote:
Original post by Chris27
That makes sense as well. So does that mean games will eventually be written using something like XNA? I don't see many people programming games using this technology so far. Not even the indy types. Also there is Interop in .NET that allows access to Win32 API if I'm not mistaken. You just have to wrap things and make sure all types are compatible between C# and C++.


Personally i'm still trying (albiet not that hard) to determine where XNA is as far as performance. It's not obvious to me that it can handle a decent amount of 3D work, though this seems unlikely. I've used MDX before and it worked as well as i expected after everything was loaded to the video card. I don't understand why i haven't seen a decent example of what XNA is capable of yet. It's got a lot of stuff in it, so i'd like to use it for something before OGL3 gets out anyways.
The movies i have seen detailing game play show 2D games with bad graphics and horrible frame rates. I suspect this is from the usual culprit though, piss poor programming in the world at large.

Share this post


Link to post
Share on other sites
Quote:
Original post by rozz666
Quote:
Original post by Chris27
I don't believe C++ is fully object oriented. From my knowlede the Windows API was written in C which isn't object oriented. This makes for more code and added confusion when making an application.


C++ is a multi-paradigm language. Windows API is not a part of C++.

Quote:
Original post by Chris27
Having to deal with memory management is a hazzard. In C++ you have to worry about deleting your pointers if you use the heap so that you don't get memory leaks.


When writing idiomatic C++ you don't have to. You should use [link href=http://en.wikipedia.org/wiki/RAII]RAII[/link] for managing resources, e.g. boost::shared_ptr or std::tr1::shared_ptr, etc. It's a lot better than garbage collectors, because you know exactly when an object is being destroyed. In a properly written C++ program you'll find at most a few delete keywords if any.

Quote:
Original post by Chris27
You have to worry a lot about which API you are using because of incompatabilities in C++.

Which incompatibilities? You mean between different compilers?


Actually I was reffering to the incompatabilities of the different platforms as you said in your first post. C++ can be used to write programs for different Operating Systems, but you have to place different code, have types that are compatible with different OSes, and use preprossing directives to make the code compatible for different OSes. Certain code will only work with the Windows API and even further it depends on weather it is a 32 bit OS or a 64 bit OS you are programming for. This isn't an issue in .NET.

I know the Windows API isn't part of C++. :) It was actually written in C like I said which wasn't an object oriented programming language at all. This makes for some ugly code to look at when it comes to using the Win32 API IMO.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!