Archived

This topic is now archived and is closed to further replies.

C# or C++

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

Ok here goes. I am moving from basic to A type of C, which should i use to make games in C# or C++ and what is a good book to get to learn it with, or a good place to get tutorials?
founder, admin, and programmer for crxgames I know two languages BASIC and English. google|bludstayne software|Click here to go to the CrX Games Site. [edited by - jumpjumpjump on December 13, 2003 7:20:05 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
depends on what kinda of games you want to make
java type web app games? c#
real games? c++

Share this post


Link to post
Share on other sites
yeah, but guys you are failing to remember that C# is a lot like java in a lot of respects, for someone who doesn''t know how to do real programming it might be a good lead in. not as many people use C# and it has some performance issues but it would be a good lead in.

just keep that in mine jump

Share this post


Link to post
Share on other sites
Funny to see how misinformed people can be around here :-).

Take a look at C#, it is much more capable than most close minded C++ developers would leave you to believe.

________________________________________________
Chris McGuirk
Lead Programmer - Axiom Engine

C# gaming, the way of the future!
http://axiomengine.sourceforge.net

Share this post


Link to post
Share on other sites
C++, i went from 0 to Dx9 in c++ in about 6 months, and im only 15, go with c++ because of performance and because as far as i can tell, its much much much more widely used (for how long i have no idea), getting help should be easier, and its not very hard to begin with, yup theres my two cents...

-Dan

Yes I realize im a n00b...

Share this post


Link to post
Share on other sites
A couple of months ago, I woulda said C#, but with the lack of resources on the specifics of GAME DEV on C#, I now recommend C++, because of the resources, and because of the popularity, hence brings more resources...

C# is a VERY GOOD language.. In some aspects better than C++.. I haven''t been able to find anything that C# lacks, that C++ can handle.. Anyone??

BattleGuard

Share this post


Link to post
Share on other sites
"C# is a VERY GOOD language.. In some aspects better than C++.. I haven''t been able to find anything that C# lacks, that C++ can handle.. Anyone??"

Pointers. However, it does have built in garbage collection... but its a good idea to learn how to do that yourself, first.

Share this post


Link to post
Share on other sites
1. I don''t really see it as necessary to know how garbage collection works yourself if you''re an application programmer. That''s something for system programmers/language programmers to care about. I mean, yeah, it''s handy, but not necessary.

2. C# and the .NET languages are going to be moving into a much more predominant position when the next generation of Windows operating systems, starting with Longhorn, are released. .NET code run like native code on the new OS and they will be deprecating the PEF.

3. The learning curve for C# is much less than that for C++. There''s no worrying about COM or windows stupidity. Pointers are there if you want to use them, but not necessary.

4. The development cycle for C# is shorter than that for C++. It is literally at least 10 times faster to code in C# than in C++ making it especially useful for hobbiest developers who don''t get paid for their time.

5. Many of the resources on programming in C++ and Java will apply to C#. You can actually almost directly transfer Java to C# and while transferring C++ to C# takes a little bit longer it is still very possible.

Share this post


Link to post
Share on other sites
"1. I don''t really see it as necessary to know how garbage collection works yourself if you''re an application programmer. That''s something for system programmers/language programmers to care about. I mean, yeah, it''s handy, but not necessary."

It is usually a good idea to at least kind of know how what you are using works. Your other points are valid (because of garbage collection), except that games are now moving away from PC, so it is very important to know how to program in an unmanaged environment if you plan on making games on a console.

Share this post


Link to post
Share on other sites
If you want to learn DirectX programming then C# is a much better choice. Look at a few managed directx tutorials vs. those based on C++. It''s so much more simple to get something done in C# so you can focus on expanding samples, making new things instead of wrestling with pointers.

But unfortunately many people base their opinion on prejudice and hearsay. Someone above me said ''go with C++ because of performance''. directx is the one area where C# is perfectly acceptable, because most of the work is in the initialisation and in the render loop you''re waiting on the present() anyway. And when you are learning, who needs performance anyway ? if you are trying a heightmap terrain demo, does it matter if it runs at 220 fps or 200, if all you want is to grasp the techniques and the concept ?

Share this post


Link to post
Share on other sites
quote:
Original post by Fidelio66
If you want to learn DirectX programming then C# is a much better choice. Look at a few managed directx tutorials vs. those based on C++. It''s so much more simple to get something done in C# so you can focus on expanding samples, making new things instead of wrestling with pointers.




Some people might say that your mind is closed to C++, if you took the itme to learn C++ you would find it just as easy to program in as C#. I assume by your comment that you are saying there are no Directx tutroials for C++? There is a complete SDK devoted to Directx with C++.

My advice is start with C++ then learn C# after a few months, C# is trivial to learn if you know C++.

Share this post


Link to post
Share on other sites
In my humble opinion, I would totally recommend C++ over C# for many reasons:

Quote from Microsoft documentation: "The Microsoft solution to this problem is a language called C# (pronounced "C sharp"). C# is a modern, object-oriented language that enables programmers to quickly build a wide range of applications for the new Microsoft .NET platform" end quote.
-­> C# is a Microsoft language. Therefore, don''t expect any portability. Contrary to what some people might think, the world does not revolve around MS operating systems, and I''m not only talking about Linux here. When it comes to games, think about the consoles too, not just Win32.

ANSI/ISO provide standards to the C++ language, but nothing for the C# language. Therefore, whatever you write in C++ today will remain valid for years and years, while you have no guarantee whatsoever that what you develop in C# will still compile tomorrow. Don''t say it never happened, I have plenty of games at home that I can''t play anymore because they require Windows95 or less. It happened in the past, it will happen in the future.

As stated by many other people already, you are more likely to find support with C++ than with C#, mostly because a lot more people (and gurus) code in C++.

I believe that any good programmer should know how to manage memory himself before letting a garbage collector do it. If you don''t know how it''s done, then how can you be sure that the garbage collector does it well?

That''s about my 2 cents worth on this topic.

------------------------
The highest sounds are hardest to hear.
Going forward is a way to retreat.
Great talent shows itself late in life.
Even a perfect program still has bugs
- The Tao of Programming

Share this post


Link to post
Share on other sites
quote:
Original post by quant

Some people might say that your mind is closed to C++, if you took the itme to learn C++ you would find it just as easy to program in as C#. I assume by your comment that you are saying there are no Directx tutroials for C++? There is a complete SDK devoted to Directx with C++.

My advice is start with C++ then learn C# after a few months, C# is trivial to learn if you know C++.



No, what I meant was look at the size of similar stuff in C# and C++ directx tutorials. For example creating a device, or rendering a cube. The C# samples are much shorter and cleaner, and if you want to learn directx and 3d graphics then I think c# will get you started and productive a lot faster than with C++.

Share this post


Link to post
Share on other sites
quote:
As stated by many other people already, you are more likely to find support with C++ than with C#, mostly because a lot more people (and gurus) code in C++.


Well, this is what they said about C vs. C++ years ago. C is faster, C produces smaller executables, nobody needs crap like classes, a real man doesn''t need inheritance or reuse because it''s always better to write it from scratch. Still C++ won, despite that back then all your gurus coded in C and C++ was only used by students.

Share this post


Link to post
Share on other sites
quote:
Original post by Sleeping2620
Quote from Microsoft documentation: "The Microsoft solution to this problem is a language called C# (pronounced "C sharp"). C# is a modern, object-oriented language that enables programmers to quickly build a wide range of applications for the new Microsoft .NET platform" end quote.
-­> C# is a Microsoft language. Therefore, don''t expect any portability. Contrary to what some people might think, the world does not revolve around MS operating systems, and I''m not only talking about Linux here. When it comes to games, think about the consoles too, not just Win32.

That''s not to say it doesn''t have the potential to become cross platform though. There are already efforts to bring the .NET platform to other operating systems. Take a look at projects such as Mono.

quote:
ANSI/ISO provide standards to the C++ language, but nothing for the C# language. Therefore, whatever you write in C++ today will remain valid for years and years, while you have no guarantee whatsoever that what you develop in C# will still compile tomorrow.

There''s both an ISO and an ECMA standard for the C# programming language, as well as standards from both committees for the Common Runtime Infrastructure. ISO/IEC 23270 and ECMA-334 are the ISO and ECMA standards for C#, respectively, and ISO/IEC 23271 and ECMA-335 are the ISO and ECMA standards for the CLI, respectively.

After using both C++ and C#, I can say that C# definately allows for faster, easier coding. More can be done in a shorter amount of time. So if you want a more forgiving language to work with, I''d say go with C#.

For beginning game development though, for the time being I''d say go with C++. Why C++? There''s a whole hell of a lot more tutorials/articles/books using C++ than there are those resources using C#. If you look at the Articles and Resources section of this site, a large majority of those articles use C++. Same thing with a lot of books. I just think you''re going to find it easier getting the information you need/want with regards to game programming if you choose to go with C++.

And for those who want to keep on believing that C# does not offer usage of pointers, I got some shocking news for you: it does.

Share this post


Link to post
Share on other sites
Yes C# is great, but I seriously doubt that it will take over game dev any time soon and maybe that's a bad thing. In game dev the money is at the console market, NOT the PC and I can't see managed code running games on the consoles.



Human beings, by changing the inner attitudes of their minds, can change the outer aspects of their lives.

William James (1842 - 1910)

[edited by - rohde on December 15, 2003 9:16:39 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by Sleeping2620
In my humble opinion, I would totally recommend C++ over C# for many reasons:

Quote from Microsoft documentation: "The Microsoft solution to this problem is a language called C# (pronounced "C sharp"). C# is a modern, object-oriented language that enables programmers to quickly build a wide range of applications for the new Microsoft .NET platform" end quote.
-­> C# is a Microsoft language. Therefore, don''t expect any portability. Contrary to what some people might think, the world does not revolve around MS operating systems, and I''m not only talking about Linux here. When it comes to games, think about the consoles too, not just Win32.

ANSI/ISO provide standards to the C++ language, but nothing for the C# language. Therefore, whatever you write in C++ today will remain valid for years and years, while you have no guarantee whatsoever that what you develop in C# will still compile tomorrow.




- It seems you need to understand the English language a little better, as well as read up on some more facts.

a) It says "The Microsoft SOLUTION TO THIS PROBLEM". You do realize that 3 years ago that EXACT SAME phrase was used when speaking about C++ right?

b) C# Specification is NOT controlled by Microsoft. Intel, HP, and Microsoft send in the specifications on the standard YEARS ago, and it is a standard.. just like C++



quote:

I believe that any good programmer should know how to manage memory himself before letting a garbage collector do it. If you don''t know how it''s done, then how can you be sure that the garbage collector does it well?



- These are the quotes that just show the person does not know anything about garbage collection. You still have to manage memory and optomize with a GC, even MORESO than being able to new and delete all over the place. Maybe you should read more on this topic before trying to blast it?

But I do agree with the point that a programmer needs to know how to manage memory. ALTHOUGH that does not mean they need to know how to use new and delete keywords, it means know how to effectively and efficiently use memory in the language of their choice.

Share this post


Link to post
Share on other sites
quote:
Original post by Imperil
- These are the quotes that just show the person does not know anything about garbage collection. You still have to manage memory and optomize with a GC, even MORESO than being able to new and delete all over the place. Maybe you should read more on this topic before trying to blast it?



I didn''t blast GC. Garbage collecting is good, garbage collecting is great. However, having the tools does not relieve you of having to know the basics.

------------------------
The highest sounds are hardest to hear.
Going forward is a way to retreat.
Great talent shows itself late in life.
Even a perfect program still has bugs
- The Tao of Programming

Share this post


Link to post
Share on other sites