Jump to content
  • Advertisement
Sign in to follow this  
igna92ts

C# and C++

This topic is 2216 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

How much harder is c++? because i was considering learning one or the other and I really don't have much time in my hands and i hear that c#and , for example , XNA are way faster to develop than c++ and ,say, sfml.
PS: I dont care about portability

Share this post


Link to post
Share on other sites
Advertisement
Why don't you search through the forum first. Or even google... Yes, it is faster to learn C# and XNA. You can probably get to making simple games in less than 2 weeks?

Share this post


Link to post
Share on other sites
I can't tell if this is a troll or someone who just woke up and decided to make a game. C# is a less complex language, however I wouldn't consider it harder. And there are more than 3 threads about this same thing on the first page of the beginners section.

Share this post


Link to post
Share on other sites
Figure it out for yourself...

Take some time and install VS2010 Express for c# and c++...all the tools that you need at this point are free. Make your goal drawing a single triangle in a window. First complete the task in c#, then in C++. Leverage the XNA (c#) and DirectX (c++) APIs/toolkits to do the drawing. Tutorials for this sort of thing are spammed all over the place. Just do some research with Google.

Get that far and you be able to ask much more specific, intelligent questions on which language and api/toolkit to learn more about. Edited by timothyjlaird

Share this post


Link to post
Share on other sites
Any language will initially be difficult for a beginner -- but yes, C#/XNA is generally considered to be a bit easier and more approachable than C++ and SFML/SDL/Allegro, unless you're already an experienced C++ programmer.


Do you have any prior programming experience, even if you think it might not be relevant to games?

What exactly do you mean when you say you don't have much time available? Do you mean you don't have much time each day, or do you mean you have a deadline (6 months to complete a game for an assignment for example?) you need to meet? If you only have a little time each day and are trying to be productive then any language you're comfortable with should be fine, but if you have a fixed deadline you might want to consider easier options than C# or C++ to help ensure your success.


I agree with the above response: trying both languages out for yourself and making a more informed opinion based on your own personal preferences is an excellent idea. Although C# is generally considered easier and faster to develop with, some people absolutely swear by C++ instead, and you may well be one of those people.

You might also consider the amount and quality of reference materials available: for each language, think up a couple of topics you think you'll need to look up/learn about, and try to find resources for each language. Take note of how much material is available for each language, and check the quality of some of them is suitable.


Hope that helps! smile.png

Share this post


Link to post
Share on other sites
I say just go ahead and learn C#. It's an essential skill for modern Windows programming to know C# (or at least some .NET language) and how to use the .NET Framework. C# will be much less painful to learn and you will be a deadly programmer when you learn it. Moving on to learning C and C++ will be FAR easier, as you will already understand programming and the languages are very similar in style, syntax and structure. But, in the end, you will need to know both to be a really effective game programmer and be eligible for a wide variety of jobs in the games industry... I just think learning C# first will be much easier.

Don't fall into the trap of thinking language A is "better" than language B. Most such claims are complete nonsense, unless we're saying BASIC and VB.NET sucks (just kidding! lol). Programming languages also do not (I repeat, do NOT) have any attribute, element or property called "power". All Turing-complete languages are "powerful". Theoretically, any Turing-complete language can calculate the entire span of existence of the known universe. C# is not "less powerful" than C or C++, nor is the reverse true. Likewise, assembly language is not more "powerful" than C... Languages also do not have any sort of fixed performance. The performance/speed of code varies from machine to machine, API to API, programmer to programmer, etc... Some languages can be theoretically faster than others due to physical limitations or advantages (e.g., JIT compiling or interpretation), but no programming language has a "top speed". Well-written C# code can easily outrun badly-written native code, and vice-versa. Managed languages, despite being theoretically slower due to JIT compiling, can sometimes be superior in performance to native code considering the gains in memory efficiency, reduced bugs, cleaner and better-written code, etc. While I can usually squeeze a couple more milliseconds out of C than I can with C#, sometimes complex algorithms can be faster in C#. It really all depends... just, like I said, never subscribe to any belief that any language is necessarily "better", "faster" or "more powerful" that any other (provided we're talking about practical, Turing-complete languages...not brainfuck or anything impractical).

If you start with C#, then you'll have the opportunity to learn the essence of Windows application programming (via Winforms) and the essence of DirectX (via XNA Framework). Both of these are easy-to-use APIs that are quick and easy to get started with but provide very deep, far-reaching and low-level capabilities. There's no reason you can't write a big, bad multi-million dollar Windows application with C#, just like you can with C or C++! There are plenty of them out there! When you feel you have "outgrown" the XNA Framework, which is like to happen when you want to write next-gen games for Windows, XBox or other platforms, then move on to learning SlimDX (the C# wrapper for DirectX and all its related APIs) and OpenGL.

Share this post


Link to post
Share on other sites

I say just go ahead and learn C#. It's an essential skill for modern Windows programming to know C# (or at least some .NET language) and how to use the .NET Framework. C# will be much less painful to learn and you will be a deadly programmer when you learn it. Moving on to learning C and C++ will be FAR easier, as you will already understand programming and the languages are very similar in style, syntax and structure. But, in the end, you will need to know both to be a really effective game programmer and be eligible for a wide variety of jobs in the games industry... I just think learning C# first will be much easier.

Don't fall into the trap of thinking language A is "better" than language B. Most such claims are complete nonsense, unless we're saying BASIC and VB.NET sucks (just kidding! lol). Programming languages also do not (I repeat, do NOT) have any attribute, element or property called "power". All Turing-complete languages are "powerful". Theoretically, any Turing-complete language can calculate the entire span of existence of the known universe. C# is not "less powerful" than C or C++, nor is the reverse true. Likewise, assembly language is not more "powerful" than C... Languages also do not have any sort of fixed performance. The performance/speed of code varies from machine to machine, API to API, programmer to programmer, etc... Some languages can be theoretically faster than others due to physical limitations or advantages (e.g., JIT compiling or interpretation), but no programming language has a "top speed". Well-written C# code can easily outrun badly-written native code, and vice-versa. Managed languages, despite being theoretically slower due to JIT compiling, can sometimes be superior in performance to native code considering the gains in memory efficiency, reduced bugs, cleaner and better-written code, etc. While I can usually squeeze a couple more milliseconds out of C than I can with C#, sometimes complex algorithms can be faster in C#. It really all depends... just, like I said, never subscribe to any belief that any language is necessarily "better", "faster" or "more powerful" that any other (provided we're talking about practical, Turing-complete languages...not brainfuck or anything impractical).

If you start with C#, then you'll have the opportunity to learn the essence of Windows application programming (via Winforms) and the essence of DirectX (via XNA Framework). Both of these are easy-to-use APIs that are quick and easy to get started with but provide very deep, far-reaching and low-level capabilities. There's no reason you can't write a big, bad multi-million dollar Windows application with C#, just like you can with C or C++! There are plenty of them out there! When you feel you have "outgrown" the XNA Framework, which is like to happen when you want to write next-gen games for Windows, XBox or other platforms, then move on to learning SlimDX (the C# wrapper for DirectX and all its related APIs) and OpenGL.


This should be required reading for everyone before posting on a [name of managed language x] vs C++ thread :)

Share this post


Link to post
Share on other sites

I can't tell if this is a troll or someone who just woke up and decided to make a game. C# is a less complex language, however I wouldn't consider it harder. And there are more than 3 threads about this same thing on the first page of the beginners section.


nooooooooo, C# is a more complex language - it has much more in it than C++ and is growing all the time (even if half of what they add these days is confusing people about the best way to use it) :) But programs written in C++ are more complex out of the necessity of dealing with a lot of machine level concepts that are dealt with for you by the C# runtime. C# has features that are far beyond anything C++ by itself can comprehend such as support for dynamic typing, memory management and a completely different system of linking & compiling that's much faster, cleaner and more advanced. There's nothing stopping you from making all these things in C++, and there are low level things you can make C++ do that are unavailable in C# (without unsafe code or interop) but those are available by virtue of the language being simple, not complex :)

Share this post


Link to post
Share on other sites
This is a really good question and a lot of people are asking it now that Microsoft has been completely silent about the future of the premier C# game programming framework, XNA. I wracked my brain for weeks a few months back on whether or not I should go C# or C++ for my future projects and I decided to stick with C#. I honestly haven't reached any computational limits with C# on rendering, collision detection, or animation yet that would warrant me going to C++. I probably will never go C++ at this point considering I don't have a team of programmers to even come close to creating a complex enough game to warrant the need for the level of tweaking that C++ gives you.

I guess if you actually plan on pursuing a career in game programming for a large studio then you might want to go C++... I think if you want to just making something cool and don't want to quit your day job doing it then go C#. Personal opinion though.

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!