Sign in to follow this  
DjMaSh

C# or C++?

Recommended Posts

Hey, Im just learning the directX api's @ tha mo and there seems to be two distinctive ways on using them. Either in c# or c++. I think i read somewhere that directX was not properly supported in C# until directX9?? Why is this? Is it because C# is a new language? or because c++ is way better. So I have the directX 9 SDK, does C# support EVERYTHING that c++ does now? Anyway, I would like to know this because using directX in C# seems alot simpler than using c++. But if there are going to be any long term disadvantages using C# I would like to know. The only obvious advantages i can think of using C++ is you have a more control over low level operations, but im just starting out simple so this is not going to be a major issue. Thanx

Share this post


Link to post
Share on other sites
The only advantage of C++ over C# that's worth talking about is that you'll be able to find more game jobs right now if you know C++. If you only know C#, you won't stand much of a chance.

If you don't really care about a job right now and want to program as a hobby, definitely go with C# - it's way easier to actually get stuff done in your free time.

Share this post


Link to post
Share on other sites
Excellent! thanx thats what I wanted to hear haha.

So what language are games like doom3 and quake4 written in? because they all use the directX api's.

Share this post


Link to post
Share on other sites
If you're asking about what language to learn first, learn C#. I'm assuming you are a beginner, so if I'm wrong, feel free to correct me.

C++ is a much more complicated language as far as I'm concerned. There's a lot of ambiguity to a beginner who isn't familiar with general programming concepts. It will be much easier for you to take a year or two to learn how to program with C# then pick up C++ in a few months, than it would be the other way around.

Remember, your first language is the hardest because you learn the language and programming theory at the same time. So, I would recommend things like C# or (especially popular with forumers around here) Python, and after you have a firm grasp with your primary language, branch out into C++.

Share this post


Link to post
Share on other sites
Quote:
Original post by templewulf
If you're asking about what language to learn first, learn C#. I'm assuming you are a beginner, so if I'm wrong, feel free to correct me.



No no, I have had quite a bit of experience with many languages, java javascript, C, c++, prolog, nqc etc.

Specifically for GAMING, I was wondering which language would benefit me more, C# or C++. I don't actually know C# yet but it looks very similar to java with a few C++ syntax changes, so it shouldn't be a problem to pick up.

Like, am I going to be disadvantaged in any way by programming in C# because I heard it was not as widely supported with directX.

Share this post


Link to post
Share on other sites
Quote:
Original post by DjMaSh
Excellent! thanx thats what I wanted to hear haha.

So what language are games like doom3 and quake4 written in? because they all use the directX api's.


Just to point out, the two games in particular that you mentioned were written primarily using OpenGL, not DirectX (though they may have Direct3D renderers on certain platforms.) Half-Life 2 is an excellent example of a popular DirectX game.

That said, the difference between Direct3D and OpenGL are mostly trivial if you understand the process behind them.


As to C# vs. C++, choose what is easiest to learn if you don't have a lot of previous experience with one already. For a total beginner, I'd recomend C#, simply because the language is simpler and the libraries are consistant and layed out well. The language also protects you from some things that can bite beginners(like memory leaks.) Either language will cover the basics for you, 90% of your aquired knowlege will transfer to the other language; more than half of it directly

Also, "Managed DirectX" is being discontinued in favor of the XNA framework, Managed DirectX 1.x is in maintainance mode only, and 2.0 will never see the light of day (Much of 2.0 became XNA.)

Share this post


Link to post
Share on other sites
Quote:
Original post by Ravyne
As to C# vs. C++, choose what is easiest to learn if you don't have a lot of previous experience with one already. For a total beginner, I'd recomend C#, simply because the language is simpler and the libraries are consistant and layed out well. The language also protects you from some things that can bite beginners(like memory leaks.) Either language will cover the basics for you, 90% of your aquired knowlege will transfer to the other language; more than half of it directly


Not to split hairs but I hate the choice of words "simpler". It makes C# sound like a less proficient language or "dumbed down". I agree with you completely, but in place of simpiler I would have said "cleaner" or "less burdened by legacy crap".

Share this post


Link to post
Share on other sites
I started programming with C++ and DirectX. Later I somehow moved to C# without noticing and found it much easier and flexible. One thing im concerned about is that first, if i try to use C++ now, i really can't... and i need to because i got into game development for developing for consoles. The only console i've heard of that uses a managed language (C#) is XBox. Ive recently started developing for GBA (homebrew) and it uses c/c++ and after using C# im finding it VERY hard to make a single gba demo. Im not sure what to do now? Should i go back to C++ and forget about C#? Please some help

Share this post


Link to post
Share on other sites
Quote:
Original post by Diirewolf
I started programming with C++ and DirectX. Later I somehow moved to C# without noticing and found it much easier and flexible. One thing im concerned about is that first, if i try to use C++ now, i really can't... and i need to because i got into game development for developing for consoles. The only console i've heard of that uses a managed language (C#) is XBox. Ive recently started developing for GBA (homebrew) and it uses c/c++ and after using C# im finding it VERY hard to make a single gba demo. Im not sure what to do now? Should i go back to C++ and forget about C#? Please some help


You aren't forgetting how to program C++ by using C#, if anything you're actually developing your programming skills. What you're experiencing is a phenomenon that all programmers experience, most people call this process "changing gears" or sometimes "changing hats" -- eg: I have to take off my C# hat and put my C++ hat back on. The problem is exascerbated by the fact that c-like languages (C, C++, C#, D, Java) are so similar. When switching from say, C to perl, the code serves as a constant reminder that that you have to think in perl because pearl code is very obviously not C code. The semantic differences between the C-like languages, on the other hand, are small and easily missed in a sea of code that looks and functions the same 95% of the time -- your brain simply doesn't realize that C++ code is different than Java without conciously thinking about it at first; it takes some time to re-train your brain to think in Java after coding in C++ for awhile. Eventually, your brain will become more used to "switching gears" and the transition will become more natural.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this